<div dir="ltr">I was taking a look at the code, and it seems easy to put interp and notes on the first page. I'll try.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 9, 2015 at 6:12 AM, Ed Maste via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 8 October 2015 at 18:23, Hal Finkel via llvm-commits<br>
<span class=""><<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Modified: lld/trunk/ELF/Writer.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=249760&r1=249759&r2=249760&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=249760&r1=249759&r2=249760&view=diff</a><br>
> ==============================================================================<br>
> --- lld/trunk/ELF/Writer.cpp (original)<br>
> +++ lld/trunk/ELF/Writer.cpp Thu Oct  8 17:23:54 2015<br>
</span><span class="">> @@ -484,8 +482,8 @@ template <class ELFT> void Writer<ELFT>:<br>
><br>
>    // Reserve space for PHDRs.<br>
>    ProgramHeaderOff = FileOff;<br>
> -  FileOff = RoundUpToAlignment(FileOff, PageSize);<br>
> -  VA = RoundUpToAlignment(VA, PageSize);<br>
> +  FileOff = RoundUpToAlignment(FileOff, Target->getPageSize());<br>
> +  VA = RoundUpToAlignment(VA, Target->getPageSize());<br>
><br>
>    if (needsInterpSection())<br>
>      PHDRs.push_back(&InterpPHDR);<br>
<br>
</span>Rounding up to a page here is one of the issues affecting LLD on<br>
FreeBSD that I posted about a couple of days ago (although it predates<br>
the change quoted above from r249760).  Rounding up puts the PT_INTERP<br>
and ELF ABI notes outside of the first page.<br>
<br>
As a local hack I changed it to round up to 512 to continue<br>
investigating other FreeBSD issues and that's sufficient for me to get<br>
further, but we need to be more clever than just reserving the first<br>
page for the PHDRs.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>