mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 18:42:46 +02:00
[llvm-readobj] Print empty line between note sections in GNU mode
This matches GNU binutils. Reviewed By: rupprecht, jhenderson, MaskRay Differential Revision: https://reviews.llvm.org/D96010
This commit is contained in:
parent
7e84b293f2
commit
6da083491b
@ -8,10 +8,11 @@
|
|||||||
// GNU-NEXT: Owner Data size Description
|
// GNU-NEXT: Owner Data size Description
|
||||||
// GNU-NEXT: AMD 0x00000000 NT_AMD_AMDGPU_HSA_METADATA (HSA Metadata)
|
// GNU-NEXT: AMD 0x00000000 NT_AMD_AMDGPU_HSA_METADATA (HSA Metadata)
|
||||||
// GNU-NEXT: HSA Metadata:
|
// GNU-NEXT: HSA Metadata:
|
||||||
// GNU-NEXT: {{^ +$}}
|
// GNU-NEXT: {{^ $}}
|
||||||
// GNU-NEXT: AMD 0x00000000 NT_AMD_AMDGPU_ISA (ISA Version)
|
// GNU-NEXT: AMD 0x00000000 NT_AMD_AMDGPU_ISA (ISA Version)
|
||||||
// GNU-NEXT: ISA Version:
|
// GNU-NEXT: ISA Version:
|
||||||
// GNU-NEXT: {{^ +$}}
|
// GNU-NEXT: {{^ $}}
|
||||||
|
// GNU-EMPTY:
|
||||||
// GNU-NEXT: Displaying notes found in: .note.desc
|
// GNU-NEXT: Displaying notes found in: .note.desc
|
||||||
// GNU-NEXT: Owner Data size Description
|
// GNU-NEXT: Owner Data size Description
|
||||||
// GNU-NEXT: AMD 0x0000000a NT_AMD_AMDGPU_HSA_METADATA (HSA Metadata)
|
// GNU-NEXT: AMD 0x0000000a NT_AMD_AMDGPU_HSA_METADATA (HSA Metadata)
|
||||||
@ -20,9 +21,11 @@
|
|||||||
// GNU-NEXT: AMD 0x00000009 NT_AMD_AMDGPU_ISA (ISA Version)
|
// GNU-NEXT: AMD 0x00000009 NT_AMD_AMDGPU_ISA (ISA Version)
|
||||||
// GNU-NEXT: ISA Version:
|
// GNU-NEXT: ISA Version:
|
||||||
// GNU-NEXT: isa_blah
|
// GNU-NEXT: isa_blah
|
||||||
|
// GNU-EMPTY:
|
||||||
// GNU-NEXT: Displaying notes found in: .note.other
|
// GNU-NEXT: Displaying notes found in: .note.other
|
||||||
// GNU-NEXT: Owner Data size Description
|
// GNU-NEXT: Owner Data size Description
|
||||||
// GNU-NEXT: AMD 0x00000000 NT_AMD_AMDGPU_PAL_METADATA (PAL Metadata)
|
// GNU-NEXT: AMD 0x00000000 NT_AMD_AMDGPU_PAL_METADATA (PAL Metadata)
|
||||||
|
// GNU-EMPTY:
|
||||||
|
|
||||||
// LLVM: Notes [
|
// LLVM: Notes [
|
||||||
// LLVM-NEXT: NoteSection {
|
// LLVM-NEXT: NoteSection {
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
# GNU-NEXT: .vgpr_count: 7
|
# GNU-NEXT: .vgpr_count: 7
|
||||||
# GNU-NEXT: .wavefront_size: 5
|
# GNU-NEXT: .wavefront_size: 5
|
||||||
# GNU-NEXT: ...
|
# GNU-NEXT: ...
|
||||||
|
# GNU-EMPTY:
|
||||||
|
|
||||||
# LLVM: Notes [
|
# LLVM: Notes [
|
||||||
# LLVM-NEXT: NoteSection {
|
# LLVM-NEXT: NoteSection {
|
||||||
|
@ -60,7 +60,7 @@ ProgramHeaders:
|
|||||||
# GNU-NEXT: /path/to/libc.so
|
# GNU-NEXT: /path/to/libc.so
|
||||||
# GNU-NEXT: 0x0000000000007000 0x0000000000008000 0x0000000000009000
|
# GNU-NEXT: 0x0000000000007000 0x0000000000008000 0x0000000000009000
|
||||||
# GNU-NEXT: [stack]
|
# GNU-NEXT: [stack]
|
||||||
# GNU-NOT: {{.}}
|
# GNU-EMPTY:
|
||||||
|
|
||||||
# LLVM: Notes [
|
# LLVM: Notes [
|
||||||
# LLVM-NEXT: NoteSection {
|
# LLVM-NEXT: NoteSection {
|
||||||
|
@ -252,6 +252,7 @@
|
|||||||
|
|
||||||
# CHECK-GNU: Owner Data size Description
|
# CHECK-GNU: Owner Data size Description
|
||||||
# CHECK-GNU-NEXT: CORE 0x00000000 [[DESC]]
|
# CHECK-GNU-NEXT: CORE 0x00000000 [[DESC]]
|
||||||
|
# CHECK-GNU-EMPTY:
|
||||||
|
|
||||||
# CHECK-LLVM: Note {
|
# CHECK-LLVM: Note {
|
||||||
# CHECK-LLVM-NEXT: Owner: CORE
|
# CHECK-LLVM-NEXT: Owner: CORE
|
||||||
|
@ -8,13 +8,16 @@
|
|||||||
// GNU-NEXT: Owner Data size Description
|
// GNU-NEXT: Owner Data size Description
|
||||||
// GNU-NEXT: FreeBSD 0x00000000 NT_THRMISC (thrmisc structure)
|
// GNU-NEXT: FreeBSD 0x00000000 NT_THRMISC (thrmisc structure)
|
||||||
// GNU-NEXT: FreeBSD 0x00000000 NT_PROCSTAT_PROC (proc data)
|
// GNU-NEXT: FreeBSD 0x00000000 NT_PROCSTAT_PROC (proc data)
|
||||||
|
// GNU-EMPTY:
|
||||||
// GNU-NEXT: Displaying notes found in: .note.bar
|
// GNU-NEXT: Displaying notes found in: .note.bar
|
||||||
// GNU-NEXT: Owner Data size Description
|
// GNU-NEXT: Owner Data size Description
|
||||||
// GNU-NEXT: FreeBSD 0x00000000 NT_PROCSTAT_FILES (files data)
|
// GNU-NEXT: FreeBSD 0x00000000 NT_PROCSTAT_FILES (files data)
|
||||||
|
// GNU-EMPTY:
|
||||||
// GNU-NEXT: Displaying notes found in: .note.baz
|
// GNU-NEXT: Displaying notes found in: .note.baz
|
||||||
// GNU-NEXT: Owner Data size Description
|
// GNU-NEXT: Owner Data size Description
|
||||||
// GNU-NEXT: FreeBSD 0x0000001c Unknown note type: (0x00000003)
|
// GNU-NEXT: FreeBSD 0x0000001c Unknown note type: (0x00000003)
|
||||||
// GNU-NEXT: description data: 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 00 00
|
// GNU-NEXT: description data: 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 00 00
|
||||||
|
// GNU-EMPTY:
|
||||||
|
|
||||||
// LLVM: Notes [
|
// LLVM: Notes [
|
||||||
// LLVM-NEXT: NoteSection {
|
// LLVM-NEXT: NoteSection {
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
// REQUIRES: x86-registered-target
|
// REQUIRES: x86-registered-target
|
||||||
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t.o
|
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t.o
|
||||||
|
|
||||||
// RUN: llvm-readobj --notes %t.o | FileCheck %s --check-prefix=LLVM
|
// RUN: llvm-readobj --notes %t.o | FileCheck %s --check-prefix=LLVM --strict-whitespace
|
||||||
// RUN: llvm-readelf --notes %t.o | FileCheck %s --check-prefix=GNU
|
// RUN: llvm-readelf --notes %t.o | FileCheck %s --check-prefix=GNU --strict-whitespace
|
||||||
|
|
||||||
// GNU: Displaying notes found in: .note.version
|
// GNU: Displaying notes found in: .note.version{{$}}
|
||||||
// GNU-NEXT: Owner Data size Description
|
// GNU-NEXT: Owner Data size Description
|
||||||
// GNU-NEXT: XYZ 0x00000000 NT_VERSION (version)
|
// GNU-NEXT: XYZ 0x00000000 NT_VERSION (version)
|
||||||
|
// GNU-EMPTY:
|
||||||
// GNU: Displaying notes found in: .note.arch
|
// GNU-NEXT: Displaying notes found in: .note.arch{{$}}
|
||||||
// GNU-NEXT: Owner Data size Description
|
// GNU-NEXT: Owner Data size Description
|
||||||
// GNU-NEXT: XYZ 0x00000000 NT_ARCH (architecture)
|
// GNU-NEXT: XYZ 0x00000000 NT_ARCH (architecture)
|
||||||
|
// GNU-EMPTY:
|
||||||
// GNU: Displaying notes found in: .note.open
|
// GNU-NEXT: Displaying notes found in: .note.open{{$}}
|
||||||
// GNU-NEXT: Owner Data size Description
|
// GNU-NEXT: Owner Data size Description
|
||||||
// GNU-NEXT: XYZ 0x00000000 OPEN
|
// GNU-NEXT: XYZ 0x00000000 OPEN
|
||||||
|
// GNU-EMPTY:
|
||||||
// GNU: Displaying notes found in: .note.func
|
// GNU-NEXT: Displaying notes found in: .note.func{{$}}
|
||||||
// GNU-NEXT: Owner Data size Description
|
// GNU-NEXT: Owner Data size Description
|
||||||
// GNU-NEXT: XYZ 0x00000000 func
|
// GNU-NEXT: XYZ 0x00000000 func
|
||||||
|
|
||||||
// LLVM: Notes [
|
// LLVM: Notes [
|
||||||
// LLVM-NEXT: NoteSection {
|
// LLVM-NEXT: NoteSection {
|
||||||
|
@ -7,10 +7,12 @@
|
|||||||
// GNU: Displaying notes found in: .note.foo
|
// GNU: Displaying notes found in: .note.foo
|
||||||
// GNU-NEXT: Owner Data size Description
|
// GNU-NEXT: Owner Data size Description
|
||||||
// GNU-NEXT: XYZ 0x00000000 Unknown note type: (0x00000003)
|
// GNU-NEXT: XYZ 0x00000000 Unknown note type: (0x00000003)
|
||||||
|
// GNU-EMPTY:
|
||||||
// GNU-NEXT: Displaying notes found in: .note.bar
|
// GNU-NEXT: Displaying notes found in: .note.bar
|
||||||
// GNU-NEXT: Owner Data size Description
|
// GNU-NEXT: Owner Data size Description
|
||||||
// GNU-NEXT: XYZ 0x0000001c Unknown note type: (0x00000003)
|
// GNU-NEXT: XYZ 0x0000001c Unknown note type: (0x00000003)
|
||||||
// GNU-NEXT: description data: 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 00 00
|
// GNU-NEXT: description data: 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 00 00
|
||||||
|
// GNU-EMPTY:
|
||||||
|
|
||||||
// LLVM: Notes [
|
// LLVM: Notes [
|
||||||
// LLVM-NEXT: NoteSection {
|
// LLVM-NEXT: NoteSection {
|
||||||
|
@ -5232,9 +5232,17 @@ static void printNotesHelper(
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class ELFT> void GNUELFDumper<ELFT>::printNotes() {
|
template <class ELFT> void GNUELFDumper<ELFT>::printNotes() {
|
||||||
|
bool IsFirstHeader = true;
|
||||||
auto PrintHeader = [&](Optional<StringRef> SecName,
|
auto PrintHeader = [&](Optional<StringRef> SecName,
|
||||||
const typename ELFT::Off Offset,
|
const typename ELFT::Off Offset,
|
||||||
const typename ELFT::Addr Size) {
|
const typename ELFT::Addr Size) {
|
||||||
|
// Print a newline between notes sections to match GNU readelf.
|
||||||
|
if (!IsFirstHeader) {
|
||||||
|
OS << '\n';
|
||||||
|
} else {
|
||||||
|
IsFirstHeader = false;
|
||||||
|
}
|
||||||
|
|
||||||
OS << "Displaying notes found ";
|
OS << "Displaying notes found ";
|
||||||
|
|
||||||
if (SecName)
|
if (SecName)
|
||||||
|
Loading…
Reference in New Issue
Block a user