[PATCH] D42748: [ELF] Don't create a .dynamic section when linking with -Bstatic

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 14:47:36 PST 2018


Alexander Richardson via Phabricator <reviews at reviews.llvm.org> writes:

> Index: ELF/Writer.cpp
> ===================================================================
> --- ELF/Writer.cpp
> +++ ELF/Writer.cpp
> @@ -326,7 +326,8 @@
>        Add(InX::HashTab);
>      }
>  
> -    Add(InX::Dynamic);
> +    if (!Config->Static)
> +      Add(InX::Dynamic);

If at all possible I would prefer not using Config->Static.

It is semantically simpler if all that -static does is pick .a over
.so. The rest of the linker should reason about "the output uses shared
libraries".

Cheers,
Rafael


More information about the llvm-commits mailing list