[MIPS] Make .data section placement coincide with _fdata symbol

Message ID 20190502161757.28322-1-fshahbazker@wavecomp.com
State New
Headers show
Series
  • [MIPS] Make .data section placement coincide with _fdata symbol
Related show

Commit Message

Faraz Shahbazker May 2, 2019, 4:16 p.m.
The _fdata symbol in MIPS linker scripts is aligned to a 16-byte
boundary.  The ALIGN function does not implicitly update current
location counter.  If sections positioned after the assignment
do not have the same natural alignment as the ALIGN function then
the start of the section group will not coincide with the value
of the symbol.

Given the linker command sequence:
  symbol = ALIGN (NN);
  (.section*)
where the idiom implies a desire to mark the beginning of .section
with symbol, there must be an assignment to the location counter
between the assignment to symbol and the .section pattern.

libgloss/
	* mips/array.ld: Update the location counter to match _fdata.
	* mips/cfe.ld: Likewise.
	* mips/ddb-kseg0.ld: Likewise.
	* mips/ddb.ld: Likewise.
	* mips/dve.ld: Likewise.
	* mips/idt.ld: Likewise.
	* mips/idt32.ld: Likewise.
	* mips/idt64.ld: Likewise.
	* mips/idtecoff.ld: Likewise.
	* mips/jmr3904app-java.ld: Likewise.
	* mips/jmr3904app.ld: Likewise.
	* mips/jmr3904dram-java.ld: Likewise.
	* mips/jmr3904dram.ld: Likewise.
	* mips/lsi.ld: Likewise.
	* mips/mti32.ld: Likewise.
	* mips/mti64.ld: Likewise.
	* mips/mti64_64.ld: Likewise.
	* mips/mti64_n32.ld: Likewise.
	* mips/nullmon.ld: Likewise.
	* mips/pmon.ld: Likewise.
	* mips/sde32.ld: Likewise.
	* mips/sde64.ld: Likewise.
---
 libgloss/mips/array.ld            | 1 +
 libgloss/mips/cfe.ld              | 1 +
 libgloss/mips/ddb-kseg0.ld        | 1 +
 libgloss/mips/ddb.ld              | 1 +
 libgloss/mips/dve.ld              | 1 +
 libgloss/mips/idt.ld              | 1 +
 libgloss/mips/idt32.ld            | 1 +
 libgloss/mips/idt64.ld            | 1 +
 libgloss/mips/idtecoff.ld         | 1 +
 libgloss/mips/jmr3904app-java.ld  | 1 +
 libgloss/mips/jmr3904app.ld       | 1 +
 libgloss/mips/jmr3904dram-java.ld | 1 +
 libgloss/mips/jmr3904dram.ld      | 1 +
 libgloss/mips/lsi.ld              | 1 +
 libgloss/mips/mti32.ld            | 1 +
 libgloss/mips/mti64.ld            | 1 +
 libgloss/mips/mti64_64.ld         | 1 +
 libgloss/mips/mti64_n32.ld        | 1 +
 libgloss/mips/nullmon.ld          | 1 +
 libgloss/mips/pmon.ld             | 1 +
 libgloss/mips/sde32.ld            | 1 +
 libgloss/mips/sde64.ld            | 1 +
 22 files changed, 22 insertions(+)

-- 
2.9.5

Comments

Faraz Shahbazker May 15, 2019, 5:12 a.m. | #1
Ping^1

https://sourceware.org/ml/newlib/2019/msg00203.html
Brian Inglis May 15, 2019, 6:31 a.m. | #2
On 2019-05-14 23:12, Faraz Shahbazker wrote:
> Ping^1

> https://sourceware.org/ml/newlib/2019/msg00203.html


A maintainer with commit rights needs to find free time to review, apply, test,
and push your changes. One is currently on vacation for a month and the others
may be busy with RHEL 8 released and IBM merger under way.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

Patch

diff --git a/libgloss/mips/array.ld b/libgloss/mips/array.ld
index 2bc49c7..0492ae5 100644
--- a/libgloss/mips/array.ld
+++ b/libgloss/mips/array.ld
@@ -148,6 +148,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/cfe.ld b/libgloss/mips/cfe.ld
index 78fb853..9a0f8d5 100644
--- a/libgloss/mips/cfe.ld
+++ b/libgloss/mips/cfe.ld
@@ -104,6 +104,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/ddb-kseg0.ld b/libgloss/mips/ddb-kseg0.ld
index 74bc1b0..8c1f926 100644
--- a/libgloss/mips/ddb-kseg0.ld
+++ b/libgloss/mips/ddb-kseg0.ld
@@ -97,6 +97,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/ddb.ld b/libgloss/mips/ddb.ld
index 8fcafd3..299106f 100644
--- a/libgloss/mips/ddb.ld
+++ b/libgloss/mips/ddb.ld
@@ -97,6 +97,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/dve.ld b/libgloss/mips/dve.ld
index adce60f..96abbbe 100644
--- a/libgloss/mips/dve.ld
+++ b/libgloss/mips/dve.ld
@@ -98,6 +98,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/idt.ld b/libgloss/mips/idt.ld
index 0d69af4..b4608bf 100644
--- a/libgloss/mips/idt.ld
+++ b/libgloss/mips/idt.ld
@@ -105,6 +105,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/idt32.ld b/libgloss/mips/idt32.ld
index 175a98b..5084df7 100644
--- a/libgloss/mips/idt32.ld
+++ b/libgloss/mips/idt32.ld
@@ -106,6 +106,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/idt64.ld b/libgloss/mips/idt64.ld
index bd217e5..a1121c6 100644
--- a/libgloss/mips/idt64.ld
+++ b/libgloss/mips/idt64.ld
@@ -107,6 +107,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/idtecoff.ld b/libgloss/mips/idtecoff.ld
index 2788cc8..0297c60 100644
--- a/libgloss/mips/idtecoff.ld
+++ b/libgloss/mips/idtecoff.ld
@@ -57,6 +57,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/jmr3904app-java.ld b/libgloss/mips/jmr3904app-java.ld
index 98ce535..92de26d 100644
--- a/libgloss/mips/jmr3904app-java.ld
+++ b/libgloss/mips/jmr3904app-java.ld
@@ -57,6 +57,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/jmr3904app.ld b/libgloss/mips/jmr3904app.ld
index d5b3109..367fc47 100644
--- a/libgloss/mips/jmr3904app.ld
+++ b/libgloss/mips/jmr3904app.ld
@@ -96,6 +96,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/jmr3904dram-java.ld b/libgloss/mips/jmr3904dram-java.ld
index 71e8403..4c0681a 100644
--- a/libgloss/mips/jmr3904dram-java.ld
+++ b/libgloss/mips/jmr3904dram-java.ld
@@ -59,6 +59,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/jmr3904dram.ld b/libgloss/mips/jmr3904dram.ld
index a2cb1ea..9e7d255 100644
--- a/libgloss/mips/jmr3904dram.ld
+++ b/libgloss/mips/jmr3904dram.ld
@@ -56,6 +56,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/lsi.ld b/libgloss/mips/lsi.ld
index ca64ab9..780c31c 100644
--- a/libgloss/mips/lsi.ld
+++ b/libgloss/mips/lsi.ld
@@ -96,6 +96,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/mti32.ld b/libgloss/mips/mti32.ld
index 41592d1..3c8daf6 100644
--- a/libgloss/mips/mti32.ld
+++ b/libgloss/mips/mti32.ld
@@ -110,6 +110,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/mti64.ld b/libgloss/mips/mti64.ld
index 8a47c47..74d7784 100644
--- a/libgloss/mips/mti64.ld
+++ b/libgloss/mips/mti64.ld
@@ -113,6 +113,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/mti64_64.ld b/libgloss/mips/mti64_64.ld
index 81704f0..d33d156 100644
--- a/libgloss/mips/mti64_64.ld
+++ b/libgloss/mips/mti64_64.ld
@@ -116,6 +116,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/mti64_n32.ld b/libgloss/mips/mti64_n32.ld
index 6c53809..5098a88 100644
--- a/libgloss/mips/mti64_n32.ld
+++ b/libgloss/mips/mti64_n32.ld
@@ -116,6 +116,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/nullmon.ld b/libgloss/mips/nullmon.ld
index 14b0d0e..5ea8b59 100644
--- a/libgloss/mips/nullmon.ld
+++ b/libgloss/mips/nullmon.ld
@@ -99,6 +99,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/pmon.ld b/libgloss/mips/pmon.ld
index 244c1f6..fff6f66 100644
--- a/libgloss/mips/pmon.ld
+++ b/libgloss/mips/pmon.ld
@@ -99,6 +99,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/sde32.ld b/libgloss/mips/sde32.ld
index 657f5f3..7273107 100644
--- a/libgloss/mips/sde32.ld
+++ b/libgloss/mips/sde32.ld
@@ -106,6 +106,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)
diff --git a/libgloss/mips/sde64.ld b/libgloss/mips/sde64.ld
index e3a0f29..0bcbe98 100644
--- a/libgloss/mips/sde64.ld
+++ b/libgloss/mips/sde64.ld
@@ -108,6 +108,7 @@  SECTIONS
     *(.gnu.linkonce.r.*)
   }
    _fdata = ALIGN(16);
+  . = _fdata;
   .data : {
     *(.data)
     *(.data.*)