diff --git a/llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml b/llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml --- a/llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml +++ b/llvm/test/tools/llvm-objcopy/MachO/Inputs/strip-all-with-dwarf.yaml @@ -33,6 +33,23 @@ reserved1: 0x00000000 reserved2: 0x00000000 reserved3: 0x00000000 + relocations: + - address: 0x0 + symbolnum: 0 + pcrel: false + length: 0 + extern: true + type: 0 + scattered: false + value: 0 + - address: 0x0 + symbolnum: 1 + pcrel: false + length: 0 + extern: true + type: 0 + scattered: false + value: 0 - sectname: __data segname: __DATA addr: 0x0000000000000024 @@ -81,6 +98,39 @@ reserved1: 0x00000000 reserved2: 0x00000000 reserved3: 0x00000000 + relocations: + - address: 0x0 + symbolnum: 0 + pcrel: false + length: 0 + extern: true + type: 0 + scattered: false + value: 0 + - address: 0x0 + symbolnum: 0 + pcrel: false + length: 0 + extern: true + type: 0 + scattered: false + value: 0 + - address: 0x0 + symbolnum: 0 + pcrel: false + length: 0 + extern: true + type: 0 + scattered: false + value: 0 + - address: 0x0 + symbolnum: 0 + pcrel: false + length: 0 + extern: true + type: 0 + scattered: false + value: 0 - sectname: __debug_macinfo segname: __DWARF addr: 0x0000000000000166 @@ -153,6 +203,15 @@ reserved1: 0x00000000 reserved2: 0x00000000 reserved3: 0x00000000 + relocations: + - address: 0x0 + symbolnum: 0 + pcrel: false + length: 0 + extern: true + type: 0 + scattered: false + value: 0 - sectname: __eh_frame segname: __TEXT addr: 0x0000000000000290 @@ -177,6 +236,15 @@ reserved1: 0x00000000 reserved2: 0x00000000 reserved3: 0x00000000 + relocations: + - address: 0x0 + symbolnum: 0 + pcrel: false + length: 0 + extern: true + type: 0 + scattered: false + value: 0 - cmd: LC_BUILD_VERSION cmdsize: 24 platform: 1 diff --git a/llvm/test/tools/llvm-objcopy/MachO/basic-big-endian-32-copy.test b/llvm/test/tools/llvm-objcopy/MachO/basic-big-endian-32-copy.test --- a/llvm/test/tools/llvm-objcopy/MachO/basic-big-endian-32-copy.test +++ b/llvm/test/tools/llvm-objcopy/MachO/basic-big-endian-32-copy.test @@ -31,8 +31,8 @@ size: 61 offset: 0x00000198 align: 4 - reloff: 0x00000250 - nreloc: 1 + reloff: 0x0 + nreloc: 0 flags: 0x80000400 reserved1: 0x00000000 reserved2: 0x00000000 @@ -43,8 +43,8 @@ size: 40 offset: 0x000001D8 align: 2 - reloff: 0x00000258 - nreloc: 2 + reloff: 0x00000 + nreloc: 0 flags: 0x02000000 reserved1: 0x00000000 reserved2: 0x00000000 @@ -67,9 +67,9 @@ sdk: 0 - cmd: LC_SYMTAB cmdsize: 24 - symoff: 616 + symoff: 592 nsyms: 2 - stroff: 640 + stroff: 616 strsize: 16 - cmd: LC_DYSYMTAB cmdsize: 80 diff --git a/llvm/test/tools/llvm-objcopy/MachO/basic-big-endian-64-copy.test b/llvm/test/tools/llvm-objcopy/MachO/basic-big-endian-64-copy.test --- a/llvm/test/tools/llvm-objcopy/MachO/basic-big-endian-64-copy.test +++ b/llvm/test/tools/llvm-objcopy/MachO/basic-big-endian-64-copy.test @@ -32,8 +32,8 @@ size: 93 offset: 0x00000220 align: 4 - reloff: 0x00000310 - nreloc: 3 + reloff: 0x0 + nreloc: 0 flags: 0x80000400 reserved1: 0x00000000 reserved2: 0x00000000 @@ -56,8 +56,8 @@ size: 32 offset: 0x000002B0 align: 3 - reloff: 0x00000328 - nreloc: 1 + reloff: 0x0 + nreloc: 0 flags: 0x02000000 reserved1: 0x00000000 reserved2: 0x00000000 @@ -80,9 +80,9 @@ sdk: 0 - cmd: LC_SYMTAB cmdsize: 24 - symoff: 816 + symoff: 784 nsyms: 2 - stroff: 848 + stroff: 816 strsize: 36 - cmd: LC_DYSYMTAB cmdsize: 80 diff --git a/llvm/test/tools/llvm-objcopy/MachO/basic-little-endian-32-copy.test b/llvm/test/tools/llvm-objcopy/MachO/basic-little-endian-32-copy.test --- a/llvm/test/tools/llvm-objcopy/MachO/basic-little-endian-32-copy.test +++ b/llvm/test/tools/llvm-objcopy/MachO/basic-little-endian-32-copy.test @@ -31,8 +31,8 @@ size: 61 offset: 0x00000198 align: 4 - reloff: 0x00000250 - nreloc: 1 + reloff: 0x0 + nreloc: 0 flags: 0x80000400 reserved1: 0x00000000 reserved2: 0x00000000 @@ -43,8 +43,8 @@ size: 40 offset: 0x000001D8 align: 2 - reloff: 0x00000258 - nreloc: 2 + reloff: 0x0 + nreloc: 0 flags: 0x02000000 reserved1: 0x00000000 reserved2: 0x00000000 @@ -67,9 +67,9 @@ sdk: 0 - cmd: LC_SYMTAB cmdsize: 24 - symoff: 616 + symoff: 592 nsyms: 2 - stroff: 640 + stroff: 616 strsize: 16 - cmd: LC_DYSYMTAB cmdsize: 80 diff --git a/llvm/test/tools/llvm-objcopy/MachO/basic-little-endian-64-copy.test b/llvm/test/tools/llvm-objcopy/MachO/basic-little-endian-64-copy.test --- a/llvm/test/tools/llvm-objcopy/MachO/basic-little-endian-64-copy.test +++ b/llvm/test/tools/llvm-objcopy/MachO/basic-little-endian-64-copy.test @@ -32,8 +32,8 @@ size: 93 offset: 0x00000220 align: 4 - reloff: 0x00000310 - nreloc: 3 + reloff: 0x0 + nreloc: 0 flags: 0x80000400 reserved1: 0x00000000 reserved2: 0x00000000 @@ -56,8 +56,8 @@ size: 32 offset: 0x000002B0 align: 3 - reloff: 0x00000328 - nreloc: 1 + reloff: 0x0 + nreloc: 0 flags: 0x02000000 reserved1: 0x00000000 reserved2: 0x00000000 @@ -80,9 +80,9 @@ sdk: 0 - cmd: LC_SYMTAB cmdsize: 24 - symoff: 816 + symoff: 784 nsyms: 2 - stroff: 848 + stroff: 816 strsize: 36 - cmd: LC_DYSYMTAB cmdsize: 80 diff --git a/llvm/test/tools/llvm-objcopy/MachO/strip-debug.test b/llvm/test/tools/llvm-objcopy/MachO/strip-debug.test --- a/llvm/test/tools/llvm-objcopy/MachO/strip-debug.test +++ b/llvm/test/tools/llvm-objcopy/MachO/strip-debug.test @@ -23,19 +23,19 @@ # RELOC: Relocations [ # RELOC-NEXT: Section __text { -# RELOC-NEXT: 0x0 0 0 0 X86_64_RELOC_UNSIGNED 0 - -# RELOC-NEXT: 0x0 0 0 0 X86_64_RELOC_UNSIGNED 0 - +# RELOC-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar +# RELOC-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar # RELOC-NEXT: } # DEBUG: Section __debug_info { -# DEBUG-NEXT: 0x0 0 0 0 X86_64_RELOC_UNSIGNED 0 - -# DEBUG-NEXT: 0x0 0 0 0 X86_64_RELOC_UNSIGNED 0 - -# DEBUG-NEXT: 0x0 0 0 0 X86_64_RELOC_UNSIGNED 0 - -# DEBUG-NEXT: 0x0 0 0 0 X86_64_RELOC_UNSIGNED 0 - +# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar +# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar +# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar +# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar # DEBUG-NEXT: } # RELOC-NEXT: Section __compact_unwind { -# RELOC-NEXT: 0x0 0 0 0 X86_64_RELOC_UNSIGNED 0 - +# RELOC-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar # RELOC-NEXT: } # DEBUG-NEXT: Section __debug_line { -# DEBUG-NEXT: 0x0 0 0 0 X86_64_RELOC_UNSIGNED 0 - +# DEBUG-NEXT: 0x0 0 0 1 X86_64_RELOC_UNSIGNED 0 _bar # DEBUG-NEXT: } # RELOC-NEXT: ]