[patch] Fix pr25919

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 08:12:02 PST 2016


> To solve the problem you don't. That is what the gold plugin does.
>
> The issue with libLTO is an API design problem. It passes the
> information about each symbol in the .o files to the caller (ld64 for
> example).

Trying to create a testcase with ld64 I found that we already avoid
the problem with a big gun:

  ErrorOr<std::unique_ptr<Module>> MOrErr =
      parseBitcodeFileImpl(Buffer, *Context,
                           /* ShouldBeLazy */ static_cast<bool>(OwnedContext));

That is, we don't lazy load the module at all when opening the file
after symbol resolution and it seems that it is from that invocation
ld64 gets its LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN.

So the patch should have no impact on the code ld64 generates. I will
add a test for that. Is the patch OK?

Cheers,
Rafael


More information about the llvm-commits mailing list