[lld] r297313 - Remove DefinedSynthetic.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 10 12:58:42 PST 2017


Hi Rafael,

On Wed, Mar 8, 2017 at 2:36 PM, Rafael Espindola via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
>
> @@ -1208,8 +1204,10 @@ template <class ELFT> void Writer<ELFT>:
>    auto Define = [&](StringRef Start, StringRef End, OutputSection *OS) {
>      // These symbols resolve to the image base if the section does not
> exist.
>      // A special value -1 indicates end of the section.
> -    addOptionalSynthetic<ELFT>(Start, OS, 0);
> -    addOptionalSynthetic<ELFT>(End, OS, OS ? -1 : 0);
> +    if (!OS && Config->pic())
> +      OS = Out::ElfHeader;
> +    addOptionalRegular<ELFT>(Start, OS, 0);
> +    addOptionalRegular<ELFT>(End, OS, OS ? -1 : 0);
>    };
>
>    Define("__preinit_array_start", "__preinit_array_end",
> Out::PreinitArray);
>

I think this will cause the _end symbols to be assigned the address of the
end of the ELF header if the section does not exist.

Sent https://reviews.llvm.org/D30843 with a fix.

Thanks,
-- 
-- 
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170310/6b4b246d/attachment.html>


More information about the llvm-commits mailing list