]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld: Document -pie -Ttext-segment=ORG generates ET_EXEC
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 25 May 2024 14:44:59 +0000 (07:44 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 25 May 2024 14:46:38 +0000 (07:46 -0700)
This is the v2 patch I am checking in.

H.J.

ld/ld.texi

index dd0af8e4f5eaafd5874eff82b087db973cb227cd..ef3706fa7ac2217bc7d68a3e2577b3300f08cc10 100644 (file)
@@ -2694,7 +2694,10 @@ Same as @option{--section-start}, with @code{.bss}, @code{.data} or
 @item -Ttext-segment=@var{org}
 @cindex text segment origin, cmd line
 When creating an ELF executable, it will set the address of the first
-byte of the text segment.
+byte of the text segment.  Note that when @option{-pie} is used with
+@option{-Ttext-segment=@var{org}}, the output executable is marked
+ET_EXEC so that the address of the first byte of the text segment will
+be guaranteed to be @var{org} at run time.
 
 @kindex -Trodata-segment=@var{org}
 @item -Trodata-segment=@var{org}