diff options
author | Greg Bellows <greg.bellows@linaro.org> | 2015-04-08 11:27:48 -0500 |
---|---|---|
committer | Greg Bellows <greg.bellows@linaro.org> | 2015-04-08 11:42:12 -0500 |
commit | 75284acd20370c87a0549207dac74a38276c1816 (patch) | |
tree | 54e48ff1662806af638303827050253d753e2fc8 | |
parent | e1aa1fc926e884df21787c02938bffe605d3f945 (diff) |
target-arm: Make EL0 images static
Signed-off-by: Greg Bellows <greg.bellows@linaro.org>
-rw-r--r-- | aarch64/el0_ns/Makefile | 4 | ||||
-rw-r--r-- | aarch64/el0_ns/el0_nsec.lds.S | 5 | ||||
-rw-r--r-- | aarch64/el0_s/Makefile | 3 | ||||
-rw-r--r-- | aarch64/el0_s/el0_sec.lds.S | 5 | ||||
-rw-r--r-- | aarch64/el1_common/el1_loader.c | 3 | ||||
-rw-r--r-- | arm/el0_ns/Makefile | 1 | ||||
-rw-r--r-- | arm/el0_ns/el0_nsec.lds.S | 5 | ||||
-rw-r--r-- | arm/el0_s/Makefile | 1 | ||||
-rw-r--r-- | arm/el0_s/el0_sec.lds.S | 5 | ||||
-rw-r--r-- | arm/el1_common/el1_loader.c | 3 |
10 files changed, 17 insertions, 18 deletions
diff --git a/aarch64/el0_ns/Makefile b/aarch64/el0_ns/Makefile index de1a76b..cd5c39a 100644 --- a/aarch64/el0_ns/Makefile +++ b/aarch64/el0_ns/Makefile @@ -15,13 +15,13 @@ CFLAGS += -I../el0_common ################################################################## $(EL0_NS_ELF): $(EL0_NS_OBJS) $(EL0_NS_LOAD) - $(LD) -fpic -pie -o $@ $(EL0_NS_OBJS) $(FLATLIBS) --script=$(EL0_NS_LOAD) + $(LD) -o $@ $(EL0_NS_OBJS) $(FLATLIBS) --script=$(EL0_NS_LOAD) $(EL0_NS_IMAGE): $(EL0_NS_ELF) $(OBJCOPY) -O binary $< $@ $(EL0_NS_LOAD): el0_nsec.lds.S Makefile ../../platform/$(PLAT)/ - $(CC) $(CFLAGS) -fpic -pie -E -P -C -o $@ $< + $(CC) $(CFLAGS) -E -P -C -o $@ $< %.o: %.S $(CC) $(CFLAGS) -mcmodel=large -c -nostdlib -o $(notdir $@) $< diff --git a/aarch64/el0_ns/el0_nsec.lds.S b/aarch64/el0_ns/el0_nsec.lds.S index fac42a2..9044725 100644 --- a/aarch64/el0_ns/el0_nsec.lds.S +++ b/aarch64/el0_ns/el0_nsec.lds.S @@ -7,15 +7,16 @@ ENTRY(main) SECTIONS { - . = 0x0; + . = EL0_NS_BASE_VA; .text . : { + _EL0_NS_TEXT_BASE = .; *(.text); - _EL0_NS_TEXT_BASE = EL0_NS_BASE_VA; _EL0_NS_TEXT_SIZE = SIZEOF(.text); } . = ALIGN(4k); .data . : { + _EL0_NS_DATA_BASE = .; *(.*data); *(.*bss); _EL0_NS_DATA_SIZE = SIZEOF(.data); diff --git a/aarch64/el0_s/Makefile b/aarch64/el0_s/Makefile index 67a5319..d552457 100644 --- a/aarch64/el0_s/Makefile +++ b/aarch64/el0_s/Makefile @@ -10,13 +10,12 @@ EL0_S_OBJS = tztest_sec.o \ -include .*.d -CFLAGS += -pie CFLAGS += -I../el0_common ################################################################## $(EL0_S_ELF): $(EL0_S_OBJS) $(EL0_S_LOAD) - $(LD) -pie -o $@ $(EL0_S_OBJS) $(FLATLIBS) --script=$(EL0_S_LOAD) + $(LD) -o $@ $(EL0_S_OBJS) $(FLATLIBS) --script=$(EL0_S_LOAD) $(EL0_S_IMAGE): $(EL0_S_ELF) $(OBJCOPY) -O binary $< $@ diff --git a/aarch64/el0_s/el0_sec.lds.S b/aarch64/el0_s/el0_sec.lds.S index c4a2b97..0c858d3 100644 --- a/aarch64/el0_s/el0_sec.lds.S +++ b/aarch64/el0_s/el0_sec.lds.S @@ -7,15 +7,16 @@ ENTRY(main) SECTIONS { - . = 0x0; + . = EL0_S_BASE_VA; .text . : { + _EL0_S_TEXT_BASE = .; *(.text); - _EL0_S_TEXT_BASE = EL0_S_BASE_VA; _EL0_S_TEXT_SIZE = SIZEOF(.text); } . = ALIGN(4k); .data . : { + _EL0_S_DATA_BASE = .; *(.*data); *(.*bss); _EL0_S_DATA_SIZE = SIZEOF(.data); diff --git a/aarch64/el1_common/el1_loader.c b/aarch64/el1_common/el1_loader.c index 312fd6e..3a9c871 100644 --- a/aarch64/el1_common/el1_loader.c +++ b/aarch64/el1_common/el1_loader.c @@ -19,8 +19,7 @@ void *el1_load_el0(char *elfbase, char *start_va) ehdr->e_ident[EI_MAG3] != ELFMAG3) { DEBUG_MSG("Invalid ELF header, exiting...\n"); SMC_EXIT(); - } else if (ehdr->e_type != ET_DYN && - (ehdr->e_machine != EM_ARM || ehdr->e_machine != EM_AARCH64)) { + } else if (ehdr->e_machine != EM_ARM && ehdr->e_machine != EM_AARCH64) { DEBUG_MSG("Incorrect ELF type (type = %d, machine = %d), exiting...\n", ehdr->e_type, ehdr->e_machine); SMC_EXIT(); diff --git a/arm/el0_ns/Makefile b/arm/el0_ns/Makefile index 2d4804a..5e3cfad 100644 --- a/arm/el0_ns/Makefile +++ b/arm/el0_ns/Makefile @@ -10,7 +10,6 @@ EL0_NS_OBJS = tztest_nsec.o \ -include .*.d -CFLAGS += -pie CFLAGS += -I../el0_common ################################################################## diff --git a/arm/el0_ns/el0_nsec.lds.S b/arm/el0_ns/el0_nsec.lds.S index 707f331..e7e089b 100644 --- a/arm/el0_ns/el0_nsec.lds.S +++ b/arm/el0_ns/el0_nsec.lds.S @@ -7,15 +7,16 @@ ENTRY(main) SECTIONS { - . = 0x0; + . = EL0_NS_BASE_VA; .text . : { + _EL0_NS_TEXT_BASE = .; *(.text); - _EL0_NS_TEXT_BASE = EL0_NS_BASE_VA; _EL0_NS_TEXT_SIZE = SIZEOF(.text); } . = ALIGN(4k); .data . : { + _EL0_NS_DATA_BASE = .; *(.*data); *(.*bss); _EL0_NS_DATA_SIZE = SIZEOF(.data); diff --git a/arm/el0_s/Makefile b/arm/el0_s/Makefile index 0613f32..336d318 100644 --- a/arm/el0_s/Makefile +++ b/arm/el0_s/Makefile @@ -10,7 +10,6 @@ EL0_S_OBJS = tztest_sec.o \ -include .*.d -CFLAGS += -pie CFLAGS += -I../el0_common ################################################################## diff --git a/arm/el0_s/el0_sec.lds.S b/arm/el0_s/el0_sec.lds.S index 31bba9b..55852ac 100644 --- a/arm/el0_s/el0_sec.lds.S +++ b/arm/el0_s/el0_sec.lds.S @@ -7,15 +7,16 @@ ENTRY(main) SECTIONS { - . = 0x0; + . = EL0_S_BASE_VA; .text . : { + _EL0_S_TEXT_BASE = .; *(.text); - _EL0_S_TEXT_BASE = EL0_S_BASE_VA; _EL0_S_TEXT_SIZE = SIZEOF(.text); } . = ALIGN(4k); .data . : { + _EL0_S_DATA_BASE = .; *(.*data); *(.*bss); _EL0_S_DATA_SIZE = SIZEOF(.data); diff --git a/arm/el1_common/el1_loader.c b/arm/el1_common/el1_loader.c index 7fe7ec0..21f6664 100644 --- a/arm/el1_common/el1_loader.c +++ b/arm/el1_common/el1_loader.c @@ -19,8 +19,7 @@ void *el1_load_el0(char *elfbase, char *start_va) ehdr->e_ident[EI_MAG3] != ELFMAG3) { DEBUG_MSG("Invalid ELF header, exiting...\n"); SMC_EXIT(); - } else if (ehdr->e_type != ET_DYN && - (ehdr->e_machine != EM_ARM || ehdr->e_machine != EM_AARCH64)) { + } else if (ehdr->e_machine != EM_ARM && ehdr->e_machine != EM_AARCH64) { DEBUG_MSG("Incorrect ELF type (type = %d, machine = %d), exiting...\n", ehdr->e_type, ehdr->e_machine); SMC_EXIT(); |