Skip to content

Commit 1b89486

Browse files
authored
[llvm-objdump] Add support for the PT_OPENBSD_SYSCALLS segment type. (llvm#82121)
Reference: https://github.com/openbsd/src/blob/master/sys/sys/exec_elf.h
1 parent 914e607 commit 1b89486

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

llvm/test/tools/llvm-objdump/openbsd-headers.test

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
1212
# CHECK-NEXT: OPENBSD_NOBTCFI off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**0
1313
# CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
14+
# CHECK-NEXT: OPENBSD_SYSCALLS off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**0
15+
# CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
1416
# CHECK-NEXT: OPENBSD_BOOTDATA off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**0
1517
# CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
1618

@@ -25,4 +27,5 @@ ProgramHeaders:
2527
- Type: 0x65a3dbe6 ## PT_OPENBSD_RANDOMIZE
2628
- Type: 0x65a3dbe7 ## PT_OPENBSD_WXNEEDED
2729
- Type: 0x65a3dbe8 ## PT_OPENBSD_NOBTCFI
30+
- Type: 0x65a3dbe9 ## PT_OPENBSD_SYSCALLS
2831
- Type: 0x65a41be6 ## PT_OPENBSD_BOOTDATA

llvm/tools/llvm-objdump/ELFDump.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ template <class ELFT> void ELFDumper<ELFT>::printProgramHeaders() {
291291
case ELF::PT_OPENBSD_RANDOMIZE:
292292
outs() << "OPENBSD_RANDOMIZE ";
293293
break;
294+
case ELF::PT_OPENBSD_SYSCALLS:
295+
outs() << "OPENBSD_SYSCALLS ";
296+
break;
294297
case ELF::PT_OPENBSD_WXNEEDED:
295298
outs() << "OPENBSD_WXNEEDED ";
296299
break;

0 commit comments

Comments
 (0)