[PATCH] D65584: [ELF] resolveUndefined: make STB_WEAK logic consistent for Undefined and SharedSymbol

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 09:34:58 PDT 2019


peter.smith added a comment.

IIUC the desired state you are proposing is:

  ld.lld %t1.o %t2.so          # ok; STB_WEAK
  ld.lld %t2.so %t1.o          # ok; STB_WEAK

I agree that ELF is underspecified here and I agree that the shared library shouldn't change the binding to non-weak in the executable (in the case where we allow undefined symbols in shared libraries). Personally I think ld.bfd's behaviour is preferable given the intention behind giving error messages from undefined symbols; i.e. catching likely errors at the earliest possible stage. If we permit it then the unfortunate user will get an undefined symbol error at run time from the dynamic loader instead of the static linker.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65584/new/

https://reviews.llvm.org/D65584





More information about the llvm-commits mailing list