[PATCH] D27276: [ELF] Allow defined symbols to be assigned from linker script
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 8 15:16:17 PST 2016
ruiu added inline comments.
================
Comment at: ELF/LinkerScript.cpp:111-118
+ if (!B || B->isUndefined()) {
+ if (Cmd->Expression.IsAbsolute())
+ Cmd->Sym = addRegular<ELFT>(Cmd);
+ else
+ Cmd->Sym = addSynthetic<ELFT>(Cmd);
+ } else {
+ Cmd->Sym = B;
----------------
meadori wrote:
> ruiu wrote:
> > I don't think you need to check if B exists. You can add a new symbol unconditionally.
> If you do it unconditionally, then duplicate symbols might be created, e.g. `foo` is defined in an input object *and* the linker script.
That shouldn't happen because of the architecture of LLD. Did you actually try that?
https://reviews.llvm.org/D27276
More information about the llvm-commits
mailing list