[lld] r292878 - Do not allocate space for common symbols with -r

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 14:57:41 PST 2017


Merged to 4.0 in r293835 as requested in PR31833.

On Mon, Jan 23, 2017 at 7:41 PM, Rui Ueyama via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: ruiu
> Date: Mon Jan 23 21:41:20 2017
> New Revision: 292878
>
> URL: http://llvm.org/viewvc/llvm-project?rev=292878&view=rev
> Log:
> Do not allocate space for common symbols with -r
>
> Currently ld.lld -r allocates space for common symbols, whereas ld.bfd
> -r doesn't.  As a result the OpenBSD makefile bits for creating libraries
> fail as they use ld -X -r to strip local symbols, which results in
> duplicate symbol errors because space for the common symbols has been
> allocated.
>
> The diff also implements the --define-commons option such that allocation
> of commons can be forced even if -r is used.
>
> Patch by Mark Kettenis.
>
> Added:
>     lld/trunk/test/ELF/relocatable-common.s
> Modified:
>     lld/trunk/ELF/Config.h
>     lld/trunk/ELF/Driver.cpp
>     lld/trunk/ELF/Options.td
>     lld/trunk/ELF/Symbols.cpp
>     lld/trunk/ELF/SyntheticSections.cpp


More information about the llvm-commits mailing list