Skip to content

Commit a921f2a

Browse files
authored
[llvm-objdump] Add support for the PT_OPENBSD_NOBTCFI segment type. (#67127)
Reference: https://github.com/openbsd/src/blob/master/sys/sys/exec_elf.h
1 parent 6ac71a0 commit a921f2a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
1010
# CHECK-NEXT: OPENBSD_WXNEEDED off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**0
1111
# CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
12+
# CHECK-NEXT: OPENBSD_NOBTCFI off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**0
13+
# CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
1214
# CHECK-NEXT: OPENBSD_BOOTDATA off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**0
1315
# CHECK-NEXT: filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
1416

@@ -22,4 +24,5 @@ ProgramHeaders:
2224
- Type: 0x65a3dbe5 ## PT_OPENBSD_MUTABLE
2325
- Type: 0x65a3dbe6 ## PT_OPENBSD_RANDOMIZE
2426
- Type: 0x65a3dbe7 ## PT_OPENBSD_WXNEEDED
27+
- Type: 0x65a3dbe8 ## PT_OPENBSD_NOBTCFI
2528
- Type: 0x65a41be6 ## PT_OPENBSD_BOOTDATA

llvm/tools/llvm-objdump/ELFDump.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ template <class ELFT> void ELFDumper<ELFT>::printProgramHeaders() {
283283
case ELF::PT_OPENBSD_MUTABLE:
284284
outs() << "OPENBSD_MUTABLE ";
285285
break;
286+
case ELF::PT_OPENBSD_NOBTCFI:
287+
outs() << "OPENBSD_NOBTCFI ";
288+
break;
286289
case ELF::PT_OPENBSD_RANDOMIZE:
287290
outs() << "OPENBSD_RANDOMIZE ";
288291
break;

0 commit comments

Comments
 (0)