2020-07-20 15:39:14 +08:00
|
|
|
// RUN: llvm-mc -triple x86_64-apple-darwin %s -filetype=obj -o - | llvm-readobj --file-headers -S --sd -r --symbols --macho-segment --macho-dysymtab --macho-indirect-symbols - | FileCheck %s
|
2010-05-20 04:35:15 +08:00
|
|
|
|
|
|
|
.tlv
|
|
|
|
.globl _a
|
|
|
|
_a:
|
|
|
|
.quad 0
|
|
|
|
.quad 0
|
|
|
|
.quad 0
|
|
|
|
|
2015-09-10 09:50:00 +08:00
|
|
|
// CHECK: File: <stdin>
|
|
|
|
// CHECK: Format: Mach-O 64-bit x86-64
|
|
|
|
// CHECK: Arch: x86_64
|
|
|
|
// CHECK: AddressSize: 64bit
|
|
|
|
// CHECK: MachHeader {
|
|
|
|
// CHECK: Magic: Magic64 (0xFEEDFACF)
|
|
|
|
// CHECK: CpuType: X86-64 (0x1000007)
|
|
|
|
// CHECK: CpuSubType: CPU_SUBTYPE_X86_64_ALL (0x3)
|
|
|
|
// CHECK: FileType: Relocatable (0x1)
|
|
|
|
// CHECK: NumOfLoadCommands: 3
|
|
|
|
// CHECK: SizeOfLoadCommands: 336
|
|
|
|
// CHECK: Flags [ (0x0)
|
|
|
|
// CHECK: ]
|
|
|
|
// CHECK: Reserved: 0x0
|
|
|
|
// CHECK: }
|
|
|
|
// CHECK: Sections [
|
|
|
|
// CHECK: Section {
|
|
|
|
// CHECK: Index: 0
|
|
|
|
// CHECK: Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
|
|
|
|
// CHECK: Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
|
|
|
|
// CHECK: Address: 0x0
|
|
|
|
// CHECK: Size: 0x0
|
|
|
|
// CHECK: Offset: 368
|
|
|
|
// CHECK: Alignment: 0
|
|
|
|
// CHECK: RelocationOffset: 0x0
|
|
|
|
// CHECK: RelocationCount: 0
|
[llvm-readobj][MachO] Fix section type printing
Summary:
Currently, llvm-readobj mistakenly decodes section type as section attribute.
This patch fixes the bug and affected tests.
Reviewers: JDevlieghere, jhenderson, rupprecht, alexshap, echristo
Reviewed By: jhenderson, rupprecht, alexshap, echristo
Subscribers: javed.absar, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66075
llvm-svn: 368974
2019-08-15 15:22:04 +08:00
|
|
|
// CHECK: Type: Regular (0x0)
|
2015-09-10 09:50:00 +08:00
|
|
|
// CHECK: Attributes [ (0x800000)
|
|
|
|
// CHECK: PureInstructions (0x800000)
|
|
|
|
// CHECK: ]
|
|
|
|
// CHECK: Reserved1: 0x0
|
|
|
|
// CHECK: Reserved2: 0x0
|
|
|
|
// CHECK: Reserved3: 0x0
|
|
|
|
// CHECK: SectionData (
|
|
|
|
// CHECK: )
|
|
|
|
// CHECK: }
|
|
|
|
// CHECK: Section {
|
|
|
|
// CHECK: Index: 1
|
|
|
|
// CHECK: Name: __thread_vars (5F 5F 74 68 72 65 61 64 5F 76 61 72 73 00 00 00)
|
|
|
|
// CHECK: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
|
|
|
|
// CHECK: Address: 0x0
|
|
|
|
// CHECK: Size: 0x18
|
|
|
|
// CHECK: Offset: 368
|
|
|
|
// CHECK: Alignment: 0
|
|
|
|
// CHECK: RelocationOffset: 0x0
|
|
|
|
// CHECK: RelocationCount: 0
|
[llvm-readobj][MachO] Fix section type printing
Summary:
Currently, llvm-readobj mistakenly decodes section type as section attribute.
This patch fixes the bug and affected tests.
Reviewers: JDevlieghere, jhenderson, rupprecht, alexshap, echristo
Reviewed By: jhenderson, rupprecht, alexshap, echristo
Subscribers: javed.absar, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66075
llvm-svn: 368974
2019-08-15 15:22:04 +08:00
|
|
|
// CHECK: Type: ThreadLocalVariables (0x13)
|
2015-09-10 09:50:00 +08:00
|
|
|
// CHECK: Attributes [ (0x0)
|
|
|
|
// CHECK: ]
|
|
|
|
// CHECK: Reserved1: 0x0
|
|
|
|
// CHECK: Reserved2: 0x0
|
|
|
|
// CHECK: Reserved3: 0x0
|
|
|
|
// CHECK: SectionData (
|
|
|
|
// CHECK: 0000: 00000000 00000000 00000000 00000000 |................|
|
|
|
|
// CHECK: 0010: 00000000 00000000 |........|
|
|
|
|
// CHECK: )
|
|
|
|
// CHECK: }
|
|
|
|
// CHECK: ]
|
|
|
|
// CHECK: Relocations [
|
|
|
|
// CHECK: ]
|
|
|
|
// CHECK: Symbols [
|
|
|
|
// CHECK: Symbol {
|
|
|
|
// CHECK: Name: _a (1)
|
|
|
|
// CHECK: Extern
|
|
|
|
// CHECK: Type: Section (0xE)
|
|
|
|
// CHECK: Section: __thread_vars (0x2)
|
|
|
|
// CHECK: RefType: UndefinedNonLazy (0x0)
|
|
|
|
// CHECK: Flags [ (0x0)
|
|
|
|
// CHECK: ]
|
|
|
|
// CHECK: Value: 0x0
|
|
|
|
// CHECK: }
|
|
|
|
// CHECK: ]
|
|
|
|
// CHECK: Indirect Symbols {
|
|
|
|
// CHECK: Number: 0
|
|
|
|
// CHECK: Symbols [
|
|
|
|
// CHECK: ]
|
|
|
|
// CHECK: }
|
|
|
|
// CHECK: Segment {
|
|
|
|
// CHECK: Cmd: LC_SEGMENT_64
|
|
|
|
// CHECK: Name:
|
|
|
|
// CHECK: Size: 232
|
|
|
|
// CHECK: vmaddr: 0x0
|
|
|
|
// CHECK: vmsize: 0x18
|
|
|
|
// CHECK: fileoff: 368
|
|
|
|
// CHECK: filesize: 24
|
|
|
|
// CHECK: maxprot: rwx
|
|
|
|
// CHECK: initprot: rwx
|
|
|
|
// CHECK: nsects: 2
|
|
|
|
// CHECK: flags: 0x0
|
|
|
|
// CHECK: }
|
|
|
|
// CHECK: Dysymtab {
|
|
|
|
// CHECK: ilocalsym: 0
|
|
|
|
// CHECK: nlocalsym: 0
|
|
|
|
// CHECK: iextdefsym: 0
|
|
|
|
// CHECK: nextdefsym: 1
|
|
|
|
// CHECK: iundefsym: 1
|
|
|
|
// CHECK: nundefsym: 0
|
|
|
|
// CHECK: tocoff: 0
|
|
|
|
// CHECK: ntoc: 0
|
|
|
|
// CHECK: modtaboff: 0
|
|
|
|
// CHECK: nmodtab: 0
|
|
|
|
// CHECK: extrefsymoff: 0
|
|
|
|
// CHECK: nextrefsyms: 0
|
|
|
|
// CHECK: indirectsymoff: 0
|
|
|
|
// CHECK: nindirectsyms: 0
|
|
|
|
// CHECK: extreloff: 0
|
|
|
|
// CHECK: nextrel: 0
|
|
|
|
// CHECK: locreloff: 0
|
|
|
|
// CHECK: nlocrel: 0
|
|
|
|
// CHECK: }
|