Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions QuoteGeneration/ae/buildenv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ LDTFLAGS_NO_CRYPTO = -L$(SGX_LIBRARY_PATH) -Wl,--whole-archive $(TRTSLIB) -Wl,--
-Wl,--start-group $(EXTERNAL_LIB_NO_CRYPTO) -Wl,--end-group \
-Wl,--version-script=$(WORK_DIR)/enclave.lds $(ENCLAVE_LDFLAGS)

LDTFLAGS += -Wl,-Map=out.map -Wl,--undefined=version -Wl,--gc-sections
LDTFLAGS_NO_CRYPTO += -Wl,-Map=out.map -Wl,--undefined=version -Wl,--gc-sections
LDTFLAGS += -Wl,-Map=out.map -Wl,--undefined=version -Wl,--gc-sections -Wl,-dynamic-linker,
LDTFLAGS_NO_CRYPTO += -Wl,-Map=out.map -Wl,--undefined=version -Wl,--gc-sections -Wl,-dynamic-linker,


vpath %.cpp $(COMMON_DIR)/src:$(LINUX_PSW_DIR)/ae/common
Expand Down
6 changes: 4 additions & 2 deletions QuoteVerification/QvE/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ ENCLAVE_LDFLAGS := -Wl,-z,relro,-z,now,-z,noexecstack -shared \
-Wl,--build-id \
-Wl,-Bdynamic -L$(SERVTD_ATTEST_BUILD_DIR) -ltdx_verify \
-Wl,-L/lib/x86_64-linux-gnu/ -lc \
-Wl,--version-script=Enclave/linux/qve_migration.lds
-Wl,--version-script=Enclave/linux/qve_migration.lds \
-Wl,--dynamic-linker,
else
ENCLAVE_LDFLAGS := -Wl,-z,relro,-z,now,-z,noexecstack -fPIC \
-Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles \
Expand All @@ -135,7 +136,8 @@ ENCLAVE_LDFLAGS := -Wl,-z,relro,-z,now,-z,noexecstack -fPIC \
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,-Map,qve.map \
-Wl,--defsym,__ImageBase=0 \
-Wl,--build-id \
-Wl,--version-script=Enclave/linux/qve.lds
-Wl,--version-script=Enclave/linux/qve.lds \
-Wl,--dynamic-linker,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, is this equivalent, or different in any way from

-Wl,--no-dynamic-linker

?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are different

  • "-Wl,--dynamic-linker," results in an ELF '.interp' section being present, with zero-length string.
  • "-Wl,--no-dynamic-linker" results in the ELF '.interp' section being entirely absent, and in addition removes the ELF program header

It is possible this difference might not matter, but I don't know enough to be confident suggesting that - similar to how "-Wl,--shared" might another option. It would need an SGX expert to analyse this and make a decision.

endif


Expand Down