[MIPS] Align _end symbol to at least 4 in all MIPS scripts

Message ID 1564444804-9846-1-git-send-email-fshahbazker@wavecomp.com
State New
Headers show
Series
  • [MIPS] Align _end symbol to at least 4 in all MIPS scripts
Related show

Commit Message

Faraz Shahbazker July 30, 2019, midnight
Left-over part of commit 84b2a020daa17d8ee5c9ec979c3d56f95e69573b

The _end marker must be aligned to 4-bytes to ensure that the last
element written does not reach beyond the address of _end.  This is
also necessary as the termination condition is an equality test
instead of an ordered test so (_end - _fbss) must be a multiple of
4-bytes.  The alignment is already correct for mti*.ld files, fix
it for all remaining MIPS scripts that don't already align to at
least 4.

libgloss/
	* mips/array.ld: Align _end to 4 byte boundary.
	* 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/pmon.ld: Likewise.
	* mips/sde32.ld: Likewise.
	* mips/sde64.ld: Likewise.
---
 libgloss/mips/array.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/pmon.ld             | 1 +
 libgloss/mips/sde32.ld            | 1 +
 libgloss/mips/sde64.ld            | 1 +
 16 files changed, 16 insertions(+)

-- 
2.7.4

Comments

Corinna Vinschen July 30, 2019, 7:39 a.m. | #1
On Jul 30 00:00, Faraz Shahbazker wrote:
> Left-over part of commit 84b2a020daa17d8ee5c9ec979c3d56f95e69573b

> 

> The _end marker must be aligned to 4-bytes to ensure that the last

> element written does not reach beyond the address of _end.  This is

> also necessary as the termination condition is an equality test

> instead of an ordered test so (_end - _fbss) must be a multiple of

> 4-bytes.  The alignment is already correct for mti*.ld files, fix

> it for all remaining MIPS scripts that don't already align to at

> least 4.

> 

> libgloss/

> 	* mips/array.ld: Align _end to 4 byte boundary.

> 	* 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/pmon.ld: Likewise.

> 	* mips/sde32.ld: Likewise.

> 	* mips/sde64.ld: Likewise.


Pushed.  I just dropped the CVS ChangeLog remnant from the commit
message.  We really don't do that anymore.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Patch

diff --git a/libgloss/mips/array.ld b/libgloss/mips/array.ld
index 0492ae5..5cdcf40 100644
--- a/libgloss/mips/array.ld
+++ b/libgloss/mips/array.ld
@@ -182,6 +182,7 @@  SECTIONS
     *(.gnu.linkonce.b.*)
     *(COMMON)
   }
+  . = ALIGN(4);
    end = .;
    _end = .;
 }
diff --git a/libgloss/mips/ddb-kseg0.ld b/libgloss/mips/ddb-kseg0.ld
index 8c1f926..a8643fd 100644
--- a/libgloss/mips/ddb-kseg0.ld
+++ b/libgloss/mips/ddb-kseg0.ld
@@ -135,6 +135,7 @@  SECTIONS
     *(COMMON)
   }
 
+   . = ALIGN(4);
    end = .;
    _end = .;
 
diff --git a/libgloss/mips/ddb.ld b/libgloss/mips/ddb.ld
index 299106f..7b899d4 100644
--- a/libgloss/mips/ddb.ld
+++ b/libgloss/mips/ddb.ld
@@ -135,6 +135,7 @@  SECTIONS
     *(COMMON)
   }
 
+  . = ALIGN(4);
    end = .;
    _end = .;
 
diff --git a/libgloss/mips/dve.ld b/libgloss/mips/dve.ld
index 96abbbe..e28c9c2 100644
--- a/libgloss/mips/dve.ld
+++ b/libgloss/mips/dve.ld
@@ -137,6 +137,7 @@  SECTIONS
     *(COMMON)
   }
 
+  . = ALIGN(4);
    end = .;
    _end = .;
 
diff --git a/libgloss/mips/idt.ld b/libgloss/mips/idt.ld
index b4608bf..a779569 100644
--- a/libgloss/mips/idt.ld
+++ b/libgloss/mips/idt.ld
@@ -143,6 +143,7 @@  SECTIONS
     *(COMMON)
   }
 
+  . = ALIGN(4);
   PROVIDE (end = .);
   _end = .;
 
diff --git a/libgloss/mips/idt32.ld b/libgloss/mips/idt32.ld
index 5084df7..8d4e4d6 100644
--- a/libgloss/mips/idt32.ld
+++ b/libgloss/mips/idt32.ld
@@ -144,6 +144,7 @@  SECTIONS
     *(COMMON)
   }
 
+  . = ALIGN(4);
    PROVIDE (end = .);
    _end = .;
 
diff --git a/libgloss/mips/idt64.ld b/libgloss/mips/idt64.ld
index a1121c6..8d996bc 100644
--- a/libgloss/mips/idt64.ld
+++ b/libgloss/mips/idt64.ld
@@ -145,6 +145,7 @@  SECTIONS
     *(COMMON)
   }
 
+  . = ALIGN(4);
   PROVIDE (end = .);
   _end = .;
 
diff --git a/libgloss/mips/idtecoff.ld b/libgloss/mips/idtecoff.ld
index 0297c60..57111e1 100644
--- a/libgloss/mips/idtecoff.ld
+++ b/libgloss/mips/idtecoff.ld
@@ -95,6 +95,7 @@  SECTIONS
     *(.gnu.linkonce.b.*)
     *(COMMON)
   }
+  . = ALIGN(4);
    end = .;
    _end = .;
 }
diff --git a/libgloss/mips/jmr3904app-java.ld b/libgloss/mips/jmr3904app-java.ld
index 92de26d..c9539fd 100644
--- a/libgloss/mips/jmr3904app-java.ld
+++ b/libgloss/mips/jmr3904app-java.ld
@@ -99,6 +99,7 @@  SECTIONS
     . = __stack ;
   }
 
+  . = ALIGN(4);
    end = .;
    _end = .;
 
diff --git a/libgloss/mips/jmr3904app.ld b/libgloss/mips/jmr3904app.ld
index 367fc47..35c2fec 100644
--- a/libgloss/mips/jmr3904app.ld
+++ b/libgloss/mips/jmr3904app.ld
@@ -137,6 +137,7 @@  SECTIONS
     . = __stack ;
   }
 
+  . = ALIGN(4);
    end = .;
    _end = .;
 
diff --git a/libgloss/mips/jmr3904dram-java.ld b/libgloss/mips/jmr3904dram-java.ld
index 4c0681a..aedd434 100644
--- a/libgloss/mips/jmr3904dram-java.ld
+++ b/libgloss/mips/jmr3904dram-java.ld
@@ -98,6 +98,7 @@  SECTIONS
     *(COMMON)
   }
 
+  . = ALIGN(4);
    end = .;
    _end = .;
 
diff --git a/libgloss/mips/jmr3904dram.ld b/libgloss/mips/jmr3904dram.ld
index 9e7d255..168c318 100644
--- a/libgloss/mips/jmr3904dram.ld
+++ b/libgloss/mips/jmr3904dram.ld
@@ -95,6 +95,7 @@  SECTIONS
     *(COMMON)
   }
 
+  . = ALIGN(4);
    end = .;
    _end = .;
 
diff --git a/libgloss/mips/lsi.ld b/libgloss/mips/lsi.ld
index 780c31c..e350419 100644
--- a/libgloss/mips/lsi.ld
+++ b/libgloss/mips/lsi.ld
@@ -133,6 +133,7 @@  SECTIONS
     *(.gnu.linkonce.b.*)
     *(COMMON)
   }
+  . = ALIGN(4);
    end = .;
    _end = .;
 }
diff --git a/libgloss/mips/pmon.ld b/libgloss/mips/pmon.ld
index fff6f66..1608cd9 100644
--- a/libgloss/mips/pmon.ld
+++ b/libgloss/mips/pmon.ld
@@ -137,6 +137,7 @@  SECTIONS
     *(COMMON)
   }
 
+  . = ALIGN(4);
    end = .;
    _end = .;
 
diff --git a/libgloss/mips/sde32.ld b/libgloss/mips/sde32.ld
index 7273107..4ef3b69 100644
--- a/libgloss/mips/sde32.ld
+++ b/libgloss/mips/sde32.ld
@@ -144,6 +144,7 @@  SECTIONS
     *(COMMON)
   }
 
+  . = ALIGN(4);
   PROVIDE (end = .);
   _end = .;
 
diff --git a/libgloss/mips/sde64.ld b/libgloss/mips/sde64.ld
index 0bcbe98..40338a1 100644
--- a/libgloss/mips/sde64.ld
+++ b/libgloss/mips/sde64.ld
@@ -146,6 +146,7 @@  SECTIONS
     *(COMMON)
   }
 
+  . = ALIGN(4);
   PROVIDE (end = .);
   _end = .;