public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Faraz Shahbazker <fshahbazker@wavecomp.com>
To: "newlib@sourceware.org" <newlib@sourceware.org>
Cc: Faraz Shahbazker <fshahbazker@wavecomp.com>,
	Richard Sandiford	<richard.sandiford@arm.com>
Subject: [PATCH, MIPS] Align _end symbol to at least 4 in all MIPS scripts
Date: Tue, 30 Jul 2019 00:00:00 -0000	[thread overview]
Message-ID: <1564444804-9846-1-git-send-email-fshahbazker@wavecomp.com> (raw)
In-Reply-To: <mpt36jl1zoa.fsf@arm.com>

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(+)

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 = .;
 
-- 
2.7.4

  parent reply	other threads:[~2019-07-30  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-18 12:14 [PATCH,MIPS 2/3] Enable reorder for crt0.S Matthew Fortune
2014-11-26 18:00 ` Steve Ellcey
2014-11-27  0:15   ` Matthew Fortune
2014-11-27  0:28     ` Jeff Johnston
2019-07-04 17:23 ` Richard Sandiford
2019-07-06  3:26   ` Faraz Shahbazker
2019-07-30  0:00   ` Faraz Shahbazker [this message]
2019-07-30  7:39     ` [PATCH, MIPS] Align _end symbol to at least 4 in all MIPS scripts Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1564444804-9846-1-git-send-email-fshahbazker@wavecomp.com \
    --to=fshahbazker@wavecomp.com \
    --cc=newlib@sourceware.org \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).