[binutils-gdb] arc: Enable -Ttext-segment

H.J. Lu hjl@sourceware.org
Tue Dec 1 12:29:44 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3ed3c10425a699c7884dbdbf865ad3766822ea07

commit 3ed3c10425a699c7884dbdbf865ad3766822ea07
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Dec 1 04:27:28 2020 -0800

    arc: Enable -Ttext-segment
    
    Define TEXT_START_ADDR and SHLIB_TEXT_START_ADDR with SEGMENT_START to
    enable -Ttext-segment.
    
            PR ld/26970
            * scripttempl/elfarc.sc (TEXT_START_ADDR): New.  Add SEGMENT_START.
            (SHLIB_TEXT_START_ADDR): Likewise.

Diff:
---
 ld/ChangeLog             | 6 ++++++
 ld/scripttempl/elfarc.sc | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 73d0a98b94d..5b26496efcf 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2020-12-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR ld/26970
+	* scripttempl/elfarc.sc (TEXT_START_ADDR): New.  Add SEGMENT_START.
+	(SHLIB_TEXT_START_ADDR): Likewise.
+
 2020-12-01  Alan Modra  <amodra@gmail.com>
 
 	* testsuite/ld-elf/elf.exp: Set ASFLAGS for tic6x.
diff --git a/ld/scripttempl/elfarc.sc b/ld/scripttempl/elfarc.sc
index ebf40b84528..3bb0c2f9c7c 100644
--- a/ld/scripttempl/elfarc.sc
+++ b/ld/scripttempl/elfarc.sc
@@ -172,6 +172,9 @@ STACK="  .stack        ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
     *(.stack)
   }"
 
+TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${TEXT_START_ADDR})"
+SHLIB_TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${SHLIB_TEXT_START_ADDR:-0})"
+
 # if this is for an embedded system, don't add SIZEOF_HEADERS.
 if [ -z "$EMBEDDED" ]; then
    test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS"


More information about the Binutils-cvs mailing list