Skip to content

Commit ce1d858

Browse files
committed
tests: When building .so from -O asm output mark as non-executable stack
For certain tests, we take the output from dtc -O asm and build it into a .so shared library which we then dlopen() for further tests. Because we don't mark it otherwise, it's treated as requiring an executable stack, which dlopen() refuses to open as of glibc-2.41. Of course, the library is pure data, no code, so it certainly doesn't need an executable stack. Add the -znoexecstack linker option to avoid the error. Fixes: dgibson/dtc#163 Reported-by: Xi Ruoyao <[email protected]> Signed-off-by: David Gibson <[email protected]>
1 parent 915daad commit ce1d858

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/run_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ run_dtc_test () {
201201
}
202202

203203
asm_to_so () {
204-
$CC -shared -o $1.test.so "$SRCDIR/data.S" $1.test.s
204+
$CC -shared -Wl,-znoexecstack -o $1.test.so "$SRCDIR/data.S" $1.test.s
205205
}
206206

207207
asm_to_so_test () {

0 commit comments

Comments
 (0)