mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 01:24:27 +00:00
fix(build): disable default PIE when linking
Commit f7ec31db2d
("Disable PIE compilation option") allowed building a
non-relocatable firmware with a default-PIE toolchain by disabling PIE
at compilation time. This prevents the compiler from generating
relocations against a GOT.
However, when a default-PIE GCC is used as the linker, the final binary
will still be a PIE, containing an (unused) GOT and dynamic symbol
table. These structures do not affect execution, but they waste space in
the firmware binary. Disable PIE at link time to recover this space.
Change-Id: I2be7ac9c1a957f6db8d75efe6e601e9a5760a925
Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
parent
f924258da7
commit
7b59241845
1 changed files with 3 additions and 0 deletions
3
Makefile
3
Makefile
|
@ -600,6 +600,9 @@ endif
|
|||
PIE_FOUND := $(findstring --enable-default-pie,${GCC_V_OUTPUT})
|
||||
ifneq ($(PIE_FOUND),)
|
||||
TF_CFLAGS += -fno-PIE
|
||||
ifneq ($(findstring gcc,$(notdir $(LD))),)
|
||||
TF_LDFLAGS += -no-pie
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(findstring gcc,$(notdir $(LD))),)
|
||||
|
|
Loading…
Add table
Reference in a new issue