[DTrace-devel] changes needed for PIE executables
David Mc Lean
david.mclean at oracle.com
Wed Nov 20 22:03:24 PST 2019
When running some tests on a fairly new Ubuntu install, I found a number
of failures in the usdt tests.
test/unittest/usdt/tst.allargs.sh
test/unittest/usdt/tst.argmap.d
test/unittest/usdt/tst.args-alt.d
test/unittest/usdt/tst.args.d
test/unittest/usdt/tst.badguess.sh
test/unittest/usdt/tst.dlclose2.sh
test/unittest/usdt/tst.eliminate.sh
test/unittest/usdt/tst.enable.d
test/unittest/usdt/tst.enable_and.d
test/unittest/usdt/tst.enable_and_2.d
test/unittest/usdt/tst.enable_or.d
test/unittest/usdt/tst.enable_or_2.d
test/unittest/usdt/tst.enable_return.d
test/unittest/usdt/tst.enable_stmt.d
test/unittest/usdt/tst.enabled.sh
test/unittest/usdt/tst.enabled2.sh
test/unittest/usdt/tst.entryreturn.sh
test/unittest/usdt/tst.fork.sh
test/unittest/usdt/tst.guess32.sh
test/unittest/usdt/tst.multiple.sh
test/unittest/usdt/tst.reeval.sh
test/unittest/usdt/tst.static.sh
test/unittest/usdt/tst.static2.sh
test/unittest/usdt/tst.tailcall.d
Something has changed in this new context (Ubuntu install 19.04) where
the tests fail.
After some searching and inspection advice from Kris and Nick, the
problem appears to stem from the executable now being PIE format.
$ readelf -h test/triggers/usdt-tst-args
shows
Type: DYN (Shared object file)
So, we have confirmation this is now a PIE file.
versus what we have seen previously:
Type: EXEC (Executable file)
The question now is how do we adapt to this new file format when running
our USDT ?
Here are the full readelf outputs for those who might be interested:
$ readelf -h test/triggers/usdt-tst-args
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x1650
Start of program headers: 64 (bytes into file)
Start of section headers: 15704 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 11
Size of section headers: 64 (bytes)
Number of section headers: 30
Section header string table index: 29
$ readelf -h test/triggers/usdt-tst-args
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x400b6c
Start of program headers: 64 (bytes into file)
Start of section headers: 11512 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 9
Size of section headers: 64 (bytes)
Number of section headers: 31
Section header string table index: 30
More information about the DTrace-devel
mailing list