mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 00:17:01 +00:00
[dsymutil] Implement support for universal mach-o object files.
This patch allows llvm-dsymutil to read universal (aka fat) macho object files and archives. The patch touches nearly everything in the BinaryHolder, but it is fairly mechinical: the methods that returned MemoryBufferRefs or ObjectFiles now return a vector of those, and the high-level access function takes a triple argument to select the architecture. There is no support yet for handling fat executables and thus no support for writing fat object files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243096 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
13
test/tools/dsymutil/ARM/fat-arch-not-found.test
Normal file
13
test/tools/dsymutil/ARM/fat-arch-not-found.test
Normal file
@@ -0,0 +1,13 @@
|
||||
# REQUIRES: object-emission
|
||||
# RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - 2>&1 | FileCheck %s
|
||||
|
||||
---
|
||||
triple: 'armv7-apple-darwin'
|
||||
objects:
|
||||
- filename: libfat-test.a(fat-test.o)
|
||||
symbols:
|
||||
- { sym: _armv7_var, objAddr: 0x0, binAddr: 0x1000, size: 0x4 }
|
||||
...
|
||||
|
||||
# CHECK: libfat-test.a(fat-test.o): No object file for requested architecture
|
||||
|
||||
2
test/tools/dsymutil/ARM/lit.local.cfg
Normal file
2
test/tools/dsymutil/ARM/lit.local.cfg
Normal file
@@ -0,0 +1,2 @@
|
||||
if not 'X86' in config.root.targets:
|
||||
config.unsupported = True
|
||||
17
test/tools/dsymutil/Inputs/fat-test.c
Normal file
17
test/tools/dsymutil/Inputs/fat-test.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/* Compile with:
|
||||
clang -c -g -arch x86_64h -arch x86_64 -arch i386 fat-test.c
|
||||
libtool -static -o libfat-test.a fat-test.o
|
||||
|
||||
To reduce the size of the fat .o:
|
||||
lipo -thin i386 -o fat-test.i386.o fat-test.o
|
||||
lipo -thin x86_64 -o fat-test.x86_64.o fat-test.o
|
||||
lipo -thin x86_64h -o fat-test.x86_64h.o fat-test.o
|
||||
lipo -create -arch x86_64h fat-test.x86_64h.o -arch x86_64 fat-test.x86_64.o -arch i386 fat-test.i386.o -o fat-test.o -segalign i386 8 -segalign x86_64 8 -segalign x86_64h 8
|
||||
*/
|
||||
#ifdef __x86_64h__
|
||||
int x86_64h_var;
|
||||
#elif defined(__x86_64__)
|
||||
int x86_64_var;
|
||||
#else
|
||||
int i386_var;
|
||||
#endif
|
||||
BIN
test/tools/dsymutil/Inputs/fat-test.o
Normal file
BIN
test/tools/dsymutil/Inputs/fat-test.o
Normal file
Binary file not shown.
BIN
test/tools/dsymutil/Inputs/libfat-test.a
Normal file
BIN
test/tools/dsymutil/Inputs/libfat-test.a
Normal file
Binary file not shown.
16
test/tools/dsymutil/X86/fat-archive-input-i386.test
Normal file
16
test/tools/dsymutil/X86/fat-archive-input-i386.test
Normal file
@@ -0,0 +1,16 @@
|
||||
# REQUIRES: object-emission
|
||||
# RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
|
||||
|
||||
---
|
||||
triple: 'i386-apple-darwin'
|
||||
objects:
|
||||
- filename: libfat-test.a(fat-test.o)
|
||||
symbols:
|
||||
- { sym: _i386_var, objAddr: 0x0, binAddr: 0x1000, size: 0x4 }
|
||||
...
|
||||
|
||||
# CHECK: .debug_info contents:
|
||||
# CHECK: DW_TAG_variable
|
||||
# CHECK-NOT: {{DW_TAG|NULL}}
|
||||
# CHECK: DW_AT_name{{.*}}"i386_var"
|
||||
|
||||
16
test/tools/dsymutil/X86/fat-object-input-x86_64.test
Normal file
16
test/tools/dsymutil/X86/fat-object-input-x86_64.test
Normal file
@@ -0,0 +1,16 @@
|
||||
# REQUIRES: object-emission
|
||||
# RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
|
||||
|
||||
---
|
||||
triple: 'x86_64-apple-darwin'
|
||||
objects:
|
||||
- filename: fat-test.o
|
||||
symbols:
|
||||
- { sym: _x86_64_var, objAddr: 0x0, binAddr: 0x1000, size: 0x4 }
|
||||
...
|
||||
|
||||
# CHECK: .debug_info contents:
|
||||
# CHECK: DW_TAG_variable
|
||||
# CHECK-NOT: {{DW_TAG|NULL}}
|
||||
# CHECK: DW_AT_name{{.*}}"x86_64_var"
|
||||
|
||||
16
test/tools/dsymutil/X86/fat-object-input-x86_64h.test
Normal file
16
test/tools/dsymutil/X86/fat-object-input-x86_64h.test
Normal file
@@ -0,0 +1,16 @@
|
||||
# REQUIRES: object-emission
|
||||
# RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
|
||||
|
||||
---
|
||||
triple: 'x86_64h-apple-darwin'
|
||||
objects:
|
||||
- filename: fat-test.o
|
||||
symbols:
|
||||
- { sym: _x86_64h_var, objAddr: 0x0, binAddr: 0x1000, size: 0x4 }
|
||||
...
|
||||
|
||||
# CHECK: .debug_info contents:
|
||||
# CHECK: DW_TAG_variable
|
||||
# CHECK-NOT: {{DW_TAG|NULL}}
|
||||
# CHECK: DW_AT_name{{.*}}"x86_64h_var"
|
||||
|
||||
Reference in New Issue
Block a user