[PATCH] D55423: [LLD][ELF] - A fix for "linker script assignment loses relative nature of section" bug.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 7 05:54:23 PST 2018


peter.smith added a comment.

Thanks for the fix. I kind of thought it might be possible to lazily postpone symbol assignments to other symbols till after linker scripts but this requires quite a bit of contextual information to know when we need the value of a symbol expression. It looks like ld.bfd has a similar post-script fixup for symbol sections and values although it just evaluates all linker defined symbols again rather than all the addresses again. That could be another option if there were performance concerns about redoing the whole of assignAddresses.

One thing I haven't checked through yet is whether there is a more specific check for a relocation to an absolute address. Ideally we wouldn't want to allow a relative relocation to symbol = 0x1000 but we would symbol = some_other_symbol. I don't know whether that is possible though given the context available at the time. Letting it through is probably the best option (rely on the user knowing what they are doing).


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

https://reviews.llvm.org/D55423





More information about the llvm-commits mailing list