[llvm] r288831 - [llvm-readobj] - Teach readobj to print PT_OPENBSD_BOOTDATA header
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 6 09:55:53 PST 2016
Author: grimar
Date: Tue Dec 6 11:55:52 2016
New Revision: 288831
URL: http://llvm.org/viewvc/llvm-project?rev=288831&view=rev
Log:
[llvm-readobj] - Teach readobj to print PT_OPENBSD_BOOTDATA header
These are OpenBSD specific program headers.
OpenBSD commit:
https://github.com/openbsd/src/commit/d39116912b9536bd77326260dc5c6e593fd4ee24
It is required for fixing PR31288.
Differential revision: https://reviews.llvm.org/D27456
Modified:
llvm/trunk/test/Object/Inputs/openbsd-phdrs.elf-x86-64
llvm/trunk/test/tools/llvm-readobj/program-headers.test
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
Modified: llvm/trunk/test/Object/Inputs/openbsd-phdrs.elf-x86-64
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/openbsd-phdrs.elf-x86-64?rev=288831&r1=288830&r2=288831&view=diff
==============================================================================
Binary files - no diff available.
Modified: llvm/trunk/test/tools/llvm-readobj/program-headers.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/program-headers.test?rev=288831&r1=288830&r2=288831&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/program-headers.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/program-headers.test Tue Dec 6 11:55:52 2016
@@ -13,7 +13,10 @@ RUN: | FileCheck %s -check-prefix EL
##
## test.s is an empty file.
## linker.script:
-## PHDRS { text PT_LOAD FILEHDR PHDRS; foo 0x65a3dbe6; bar 0x65a3dbe7; }
+## PHDRS { text PT_LOAD FILEHDR PHDRS; foo 0x65a3dbe6; bar 0x65a3dbe7; zed 0x65a41be6; }
+## Where 0x65a3dbe6 is the value of PT_OPENBSD_RANDOMIZE,
+## 0x65a3dbe7 is the value of PT_OPENBSD_WXNEEDED,
+## 0x65a41be6 is the value of PT_OPENBSD_BOOTDATA
## SECTIONS { . = SIZEOF_HEADERS; .all : { *(.*) } : text }
RUN: llvm-readobj -program-headers %p/../../Object/Inputs/openbsd-phdrs.elf-x86-64 \
RUN: | FileCheck %s -check-prefix OPENBSD-X86-64
@@ -169,6 +172,17 @@ OPENBSD-X86-64-NEXT: Type: PT_OPENB
OPENBSD-X86-64-NEXT: Offset:
OPENBSD-X86-64-NEXT: VirtualAddress:
OPENBSD-X86-64-NEXT: PhysicalAddress:
+OPENBSD-X86-64-NEXT: FileSize:
+OPENBSD-X86-64-NEXT: MemSize:
+OPENBSD-X86-64-NEXT: Flags [
+OPENBSD-X86-64-NEXT: ]
+OPENBSD-X86-64-NEXT: Alignment:
+OPENBSD-X86-64-NEXT: }
+OPENBSD-X86-64-NEXT: ProgramHeader {
+OPENBSD-X86-64-NEXT: Type: PT_OPENBSD_BOOTDATA
+OPENBSD-X86-64-NEXT: Offset:
+OPENBSD-X86-64-NEXT: VirtualAddress:
+OPENBSD-X86-64-NEXT: PhysicalAddress:
OPENBSD-X86-64-NEXT: FileSize:
OPENBSD-X86-64-NEXT: MemSize:
OPENBSD-X86-64-NEXT: Flags [
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=288831&r1=288830&r2=288831&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Tue Dec 6 11:55:52 2016
@@ -1160,6 +1160,7 @@ static const char *getElfSegmentType(uns
LLVM_READOBJ_ENUM_CASE(ELF, PT_OPENBSD_RANDOMIZE);
LLVM_READOBJ_ENUM_CASE(ELF, PT_OPENBSD_WXNEEDED);
+ LLVM_READOBJ_ENUM_CASE(ELF, PT_OPENBSD_BOOTDATA);
default: return "";
}
More information about the llvm-commits
mailing list