[tip:,x86/sgx] selftests/sgx: Discard unsupported ELF sections

Message ID 170205917625.398.13315444953275165354.tip-bot2@tip-bot2
State New
Headers
Series [tip:,x86/sgx] selftests/sgx: Discard unsupported ELF sections |

Commit Message

tip-bot2 for Thomas Gleixner Dec. 8, 2023, 6:12 p.m. UTC
  The following commit has been merged into the x86/sgx branch of tip:

Commit-ID:     ec44ca1e34bc3a9864a8c1bf8636066ec6d5d2e5
Gitweb:        https://git.kernel.org/tip/ec44ca1e34bc3a9864a8c1bf8636066ec6d5d2e5
Author:        Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
AuthorDate:    Thu, 05 Oct 2023 17:38:53 +02:00
Committer:     Dave Hansen <dave.hansen@linux.intel.com>
CommitterDate: Fri, 08 Dec 2023 10:05:28 -08:00

selftests/sgx: Discard unsupported ELF sections

Building the test enclave with -static-pie may produce a dynamic symbol
table, but this is not supported for enclaves and any relocations need to
happen manually (e.g., as for "encl_op_array"). Thus, opportunistically
discard ".dyn*" and ".gnu.hash" which the enclave loader cannot handle.

Signed-off-by: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/all/20231005153854.25566-13-jo.vanbulck%40cs.kuleuven.be
---
 tools/testing/selftests/sgx/test_encl.lds | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/tools/testing/selftests/sgx/test_encl.lds b/tools/testing/selftests/sgx/test_encl.lds
index 333a3e7..ffe851a 100644
--- a/tools/testing/selftests/sgx/test_encl.lds
+++ b/tools/testing/selftests/sgx/test_encl.lds
@@ -33,6 +33,8 @@  SECTIONS
 		*(.note*)
 		*(.debug*)
 		*(.eh_frame*)
+		*(.dyn*)
+		*(.gnu.hash)
 	}
 }