diff --git a/llvm/test/tools/dsymutil/ARM/preload.test b/llvm/test/tools/dsymutil/ARM/preload.test new file mode 100644 --- /dev/null +++ b/llvm/test/tools/dsymutil/ARM/preload.test @@ -0,0 +1,10 @@ +$ cat foo.c +void start(void) asm("start"); +void start(void) {} +$ xcrun clang -c -o foo.o foo.c -g3 +$ xcrun clang -o foo foo.o -g3 -Wl,-preload -nodefaultlibs + +RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/preload/foo -o %t.dSYM +RUN: llvm-nm %p/../Inputs/private/tmp/preload/foo | FileCheck %s +RUN: llvm-nm %t.dSYM/Contents/Resources/DWARF/foo | FileCheck %s +CHECK: start diff --git a/llvm/test/tools/dsymutil/Inputs/private/tmp/preload/foo b/llvm/test/tools/dsymutil/Inputs/private/tmp/preload/foo new file mode 100755 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@ BuildVersionCmd; memset(&UUIDCmd, 0, sizeof(UUIDCmd)); @@ -420,14 +413,16 @@ BuildVersionCmd.push_back(Cmd); break; } + case MachO::LC_SYMTAB: + HasSymtab = true; + break; default: break; } } // If we have a valid symtab to copy, do it. - bool ShouldEmitSymtab = - isExecutable(InputBinary) && hasLinkEditSegment(InputBinary); + bool ShouldEmitSymtab = HasSymtab && isExecutable(InputBinary); if (ShouldEmitSymtab) { LoadCommandSize += sizeof(MachO::symtab_command); ++NumLoadCommands;