arc: Enable -Ttext-segment
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 1 Dec 2020 12:27:28 +0000 (04:27 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 1 Dec 2020 12:27:41 +0000 (04:27 -0800)
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.

ld/ChangeLog
ld/scripttempl/elfarc.sc

index 73d0a98b94d4ca11871b8524dbf0059ba3736769..5b26496efcff31ab294bf492f1ddc2c412262fdd 100644 (file)
@@ -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.
index ebf40b84528e30794003d7421df1a665ec9eb748..3bb0c2f9c7c41ccbcff5d89c9206e1ebeee32548 100644 (file)
@@ -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"