[PATCH] D63564: Add undefined symbols from linker script to output file

Ilie Halip via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 20 03:29:14 PDT 2019


ihalip added a comment.

In D63564#1551417 <https://reviews.llvm.org/D63564#1551417>, @MaskRay wrote:

> It and the behavior I observed from ld.bfd do appear to suggest `-u` and `EXTERN()` should be handled the same way. However, this patch adds an undefined symbol for `EXTERN()` but does not do the same for `-u`. I think if we want to fix the issue, we should make the two consistent.


You're right, this change only handles the `EXTERN()` case. It should be reworked to also handle `-u`/`--undefined`.

> Meanwhile, can you check, in the Linux kernel, if the `EXTERN(__memcat_p)` can be moved from the `-r` link (`lib/lib-ksyms.o`) to a subsequent link? The combined `-r -u` looks a bit unusual and I am not sure if that is desired.

I don't think so, I didn't find any combination of command-line params to ld.lld that would make it add the symbol into the linked binary.

> if we let Driver.cpp Config->Undefined add an undefined symbol, test will be added to both `.symtab` and `.dynsym`

Yes, I also see that. Looking into it...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63564





More information about the llvm-commits mailing list