mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
Use crtbeginT.o and crtend.o for non-PIE static executables
When static PIE is enabled by default, we shouldn't use crtbeginS.o and crtendS.o for non-PIE static executables. Check $($(@F)-no-pie) to use crtbeginT.o and crtend.o to create non-PIE static executables. Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
This commit is contained in:
parent
f8d8b1b1e6
commit
727aacfd66
1 changed files with 6 additions and 4 deletions
10
Makeconfig
10
Makeconfig
|
@ -705,13 +705,15 @@ endif
|
|||
+prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginS.o`
|
||||
+postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtendS.o`
|
||||
# Variants of the two previous definitions for statically linking programs.
|
||||
static-prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginT.o`
|
||||
static-postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
|
||||
ifeq (yes,$(enable-static-pie))
|
||||
# Static PIE must use PIE variants.
|
||||
+prectorT = $(+prectorS)
|
||||
+postctorT = $(+postctorS)
|
||||
+prectorT = $(if $($(@F)-no-pie),$(static-prector),$(+prectorS))
|
||||
+postctorT = $(if $($(@F)-no-pie),$(static-postctor),$(+postctorS))
|
||||
else
|
||||
+prectorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginT.o`
|
||||
+postctorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
|
||||
+prectorT = $(static-prector)
|
||||
+postctorT =$(static-postctor)
|
||||
endif
|
||||
csu-objpfx = $(common-objpfx)csu/
|
||||
elf-objpfx = $(common-objpfx)elf/
|
||||
|
|
Loading…
Add table
Reference in a new issue