[PATCH] arc: Enable -Ttext-segment

H.J. Lu hjl.tools@gmail.com
Sun Nov 29 13:17:03 GMT 2020


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/scripttempl/elfarc.sc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ld/scripttempl/elfarc.sc b/ld/scripttempl/elfarc.sc
index ebf40b8452..3bb0c2f9c7 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"
-- 
2.28.0



More information about the Binutils mailing list