Skip to contentSkip to conversation

selftests/x86/sgx: Fix objcopy call in the Makefile

PATCH Superseded Jarkko Sakkinen 1 participant 1 message Aug 16, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/x86/sgx: Fix objcopy call in the Makefile

Use $(OBJCOPY) to point to the correct objcopy binary. Do not discard .got.plt because we need to detect libcalls and fail the compilation if they exist.

---
 tools/testing/selftests/x86/sgx/Makefile | 2 +-
 tools/testing/selftests/x86/sgx/encl.lds | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/x86/sgx/Makefile +1 -1
index 10136b73096b..018814d0305b 100644
@@ -23,7 +23,7 @@ $(OUTPUT)/encl_piggy.o: $(OUTPUT)/encl.bin $(OUTPUT)/encl.ss
 	$(CC) $(HOST_CFLAGS) -c encl_piggy.S -o $@
 
 $(OUTPUT)/encl.bin: $(OUTPUT)/encl.elf $(OUTPUT)/sgxsign
-	objcopy --remove-section=.got.plt -O binary $< $@
+	$(OBJCOPY) -O binary $< $@
 
 $(OUTPUT)/encl.elf: $(OUTPUT)/encl.o $(OUTPUT)/encl_bootstrap.o
 	$(CC) $(ENCL_CFLAGS) -T encl.lds -o $@ $^
tools/testing/selftests/x86/sgx/encl.lds +1 -0
index 2ee01ac3ec79..9a56d3064104 100644
@@ -31,3 +31,4 @@ ASSERT(!DEFINED(.altinstructions), "ALTERNATIVES are not supported in enclaves")
 ASSERT(!DEFINED(.altinstr_replacement), "ALTERNATIVES are not supported in enclaves")
 ASSERT(!DEFINED(.discard.retpoline_safe), "RETPOLINE ALTERNATIVES are not supported in enclaves")
 ASSERT(!DEFINED(.discard.nospec), "RETPOLINE ALTERNATIVES are not supported in enclaves")
+ASSERT(!DEFINED(.got.plt), "Libcalls are not supported in enclaves")
Signature · 1 line
2.20.1