[PATCH] D105364: [lld-macho] Drop assertions that all symbols are in GOT
Vy Nguyen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 6 09:43:43 PDT 2021
oontvoo added a comment.
In D105364#2856521 <https://reviews.llvm.org/D105364#2856521>, @thakis wrote:
> The "Related bug:" was fixed D104502 <https://reviews.llvm.org/D104502> as far as as I know – can you say more about the motivation here?
The ultimate motivation is to be able to link the Cronet framework :)
The simplest repro case for that is to link this:
echo "int main() {return 0;}" > test.cc
clang -g -c -g -o test1.o test.cc
ld -r -o test2.o test1.o;
ld64.lld.darwinnew -platform_version macos 11.3 11.0 -arch x86_64 test2.o
Right now it tripped on the `assert(isInGOT)`.
Previously, it was complaining about invalid symbols, then about non-section relocs.
Yes, it seems D104502 <https://reviews.llvm.org/D104502> has handled the bug in non-section relocs, but the inGoT assert is still there, hence this patch.
In D105364#2857202 <https://reviews.llvm.org/D105364#2857202>, @int3 wrote:
> The motivation was from D105210 <https://reviews.llvm.org/D105210> -- the test case initially constructed while fixing PR50812 had symbol relocs in compact unwind, so I asked @oontvoo to split it out -- thanks for doing it :)
>
> However, given that the cause of the bug is unrelated to N_STABS, I think we should have it in a different test file. Also, is this not something that we can test via assembly, instead of YAML?
The problem is right now you can't produce a an object file that would be similar to what `ld -r` would produce (ie., with debug symols).
> Perhaps we should also rename the test (like @MaskRay suggested <https://reviews.llvm.org/rGbf7f846b683077a8adcb229624082e525870229b#1009321>) -- in addition to making it easier for the reader to understand context, it also encourages grouping tests by functionality tested, instead of by bug origin.
Good point - I'd missed the comment.
Will address it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105364/new/
https://reviews.llvm.org/D105364
More information about the llvm-commits
mailing list