Unverified Commit 9d0ac836 authored by Soby Mathew's avatar Soby Mathew Committed by GitHub
Browse files

Merge pull request #1880 from lmayencourt/lm/pie

PIE: fix linking with pie and binutils > 2.27 
parents b79239db 80e19897
...@@ -371,7 +371,7 @@ endif ...@@ -371,7 +371,7 @@ endif
ifeq ($(ENABLE_PIE),1) ifeq ($(ENABLE_PIE),1)
TF_CFLAGS += -fpie TF_CFLAGS += -fpie
TF_LDFLAGS += -pie TF_LDFLAGS += -pie --no-dynamic-linker
else else
PIE_FOUND := $(findstring --enable-default-pie,${GCC_V_OUTPUT}) PIE_FOUND := $(findstring --enable-default-pie,${GCC_V_OUTPUT})
ifneq ($(PIE_FOUND),) ifneq ($(PIE_FOUND),)
......
...@@ -531,8 +531,8 @@ func fixup_gdt_reloc ...@@ -531,8 +531,8 @@ func fixup_gdt_reloc
#endif #endif
/* /*
* Calculate the offset based on return address in x30. * Calculate the offset based on return address in x30.
* Assume that this funtion is called within a page of the start of * Assume that this function is called within a page at the start of
* of fixup region. * fixup region.
*/ */
and x2, x30, #~(PAGE_SIZE - 1) and x2, x30, #~(PAGE_SIZE - 1)
sub x0, x2, x6 /* Diff(S) = Current Address - Compiled Address */ sub x0, x2, x6 /* Diff(S) = Current Address - Compiled Address */
...@@ -580,13 +580,13 @@ func fixup_gdt_reloc ...@@ -580,13 +580,13 @@ func fixup_gdt_reloc
* *
* r_offset is address of reference * r_offset is address of reference
* r_info is symbol index and type of relocation (in this case * r_info is symbol index and type of relocation (in this case
* 0x403 which corresponds to R_AARCH64_RELATIV). * 0x403 which corresponds to R_AARCH64_RELATIVE).
* r_addend is constant part of expression. * r_addend is constant part of expression.
* *
* Size of Elf64_Rela structure is 24 bytes. * Size of Elf64_Rela structure is 24 bytes.
*/ */
1: 1:
/* Assert that the relocation type is R_AARCH64_RELATIV */ /* Assert that the relocation type is R_AARCH64_RELATIVE */
#if ENABLE_ASSERTIONS #if ENABLE_ASSERTIONS
ldr x3, [x1, #8] ldr x3, [x1, #8]
cmp x3, #0x403 cmp x3, #0x403
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment