Author: David Spickett
Date: 2026-07-30T09:50:14Z
New Revision: 2f7a0da7ba3d1de5311118d60e685432238d4e72

URL: 
https://github.com/llvm/llvm-project/commit/2f7a0da7ba3d1de5311118d60e685432238d4e72
DIFF: 
https://github.com/llvm/llvm-project/commit/2f7a0da7ba3d1de5311118d60e685432238d4e72.diff

LOG: [lldb][test] Fix TestMinidumpSizeOfImage.py with glibc >= 2.41 (#212972)

Test added by #188363.

In glibc 2.41:
> * dlopen and dlmopen no longer make the stack executable if a shared
> library requires it, either implicitly because of a missing GNU_STACK
> ELF header (and default ABI permission having the executable bit set)
>   or explicitly because of the executable bit in GNU_STACK, and the
>   stack is not already executable.  Instead, loading such objects will
>   fail.

https://lists.gnu.org/archive/html/info-gnu/2025-01/msg00014.html

The test program used for this test provides all the PHDRS itself, but
did not include a PT_GNU_STACK entry.

So the loader would assume it wanted exectuable stack. The main program
was not using an executable stack and so the loader refused to change
that, so loading the object fails.

dlopen failed:
lldb-test-build/functionalities/process_save_core_minidump_size_of_image/TestMinidumpSizeOfImage/libtestlib.so:
cannot enable executable stack as shared object requires: Invalid
argument

To fix this provide a PT_GNU_STACK with value 6 aka read and write but
not execute.

Added: 
    

Modified: 
    
lldb/test/API/functionalities/process_save_core_minidump_size_of_image/TestMinidumpSizeOfImage.py

Removed: 
    


################################################################################
diff  --git 
a/lldb/test/API/functionalities/process_save_core_minidump_size_of_image/TestMinidumpSizeOfImage.py
 
b/lldb/test/API/functionalities/process_save_core_minidump_size_of_image/TestMinidumpSizeOfImage.py
index 81f799dd4c655..c029f4ad36aaf 100644
--- 
a/lldb/test/API/functionalities/process_save_core_minidump_size_of_image/TestMinidumpSizeOfImage.py
+++ 
b/lldb/test/API/functionalities/process_save_core_minidump_size_of_image/TestMinidumpSizeOfImage.py
@@ -24,7 +24,7 @@ def build_shared_lib(self):
         with open(lds, "w") as f:
             f.write(
                 "PHDRS { ro PT_LOAD FLAGS(5); rw PT_LOAD FLAGS(6);"
-                " dyn PT_DYNAMIC FLAGS(6); }\n"
+                " dyn PT_DYNAMIC FLAGS(6); stack PT_GNU_STACK FLAGS(6); }\n"
                 "SECTIONS {\n"
                 "  . = SIZEOF_HEADERS;\n"
                 "  .hash : { *(.hash) } :ro\n"


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to