[PATCH] D42823: Strip .note.gnu.build-id sections if --build-id is given.
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 1 19:03:01 PST 2018
LGTM with a nit:
> Index: lld/ELF/InputFiles.cpp
> ===================================================================
> --- lld/ELF/InputFiles.cpp
> +++ lld/ELF/InputFiles.cpp
> @@ -618,6 +618,13 @@
> if (Name.startswith(".gnu.linkonce."))
> return &InputSection::Discarded;
>
> + // If we are creating a new .build-id section, strip existing .build-id
> + // sections so that the output won't have more than one .build-id.
> + // Usually, input object files don't contain .build-id sections, but if you
> + // create them with "ld -r --build-id", they contain it.
> + if (Name == ".note.gnu.build-id" && Config->BuildId != BuildIdKind::None)
> + return &InputSection::Discarded;
Mention that both bfd and gold also create a .note.gnu.build-id section
with -r -build-id.
Cheers,
Rafael
More information about the llvm-commits
mailing list