[JITLink][MachO] Use correct symbol scope when N_PEXT is set and N_EXT unset.
authorLang Hames <lhames@gmail.com>
Sat, 15 Aug 2020 22:45:49 +0000 (15:45 -0700)
committerLang Hames <lhames@gmail.com>
Sat, 15 Aug 2020 22:53:33 +0000 (15:53 -0700)
commita49b05bb61f73eee3ebfa6c985c1d19356d383b5
treec58008a74ae17b5a55094f3a9b29973d256fcb64
parent22cbe40fa99795766f352c08a7c0748704c9d2d5
[JITLink][MachO] Use correct symbol scope when N_PEXT is set and N_EXT unset.

MachOLinkGraphBuilder has been treating these as hidden, but they should be
treated as local.

Symbols with N_PEXT set and N_EXT unset are produced when hidden symbols are
run through 'ld -r' without passing -keep_private_externs. They will show up
under 'nm -m' as "was private extern", hence the name of the test cases.

Testcase commited as relocatable object to ensure that the test suite doesn't
depend on having 'ld -r' available.
llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
llvm/test/ExecutionEngine/JITLink/X86/Inputs/MachO_x86-64_was_private_extern.o [new file with mode: 0644]
llvm/test/ExecutionEngine/JITLink/X86/MachO_x86-64_was_private_extern.test [new file with mode: 0644]