[PATCH] D38907: Give .note.gnu.build-id section alignment 4

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 14:52:37 PDT 2017


When we create an output section, its alignment is set to the largest
alignment of input sections, so as long as you have a linker-synthesized
.note.gnu.build-id section, it sets to at least 4 after this change. If you
do not pass --build-id to the linker, it is more like a garbage-in
garbage-out situation. If a tool that generates object files decided to use
alignment 1 or 2 for .note sections for whatever reason, I think the linker
should respect that instead of being too picky and complaining about input
files.

On Mon, Oct 30, 2017 at 2:35 PM, Joerg Sonnenberger via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> On Mon, Oct 30, 2017 at 01:31:58PM -0700, Roland McGrath via llvm-commits
> wrote:
> > Despite what the so-called "spec" says, in actual fact, the note header's
> > fields are 32-bit in both ELFCLASS32 and ELFCLASS64 and the expected
> > alignment is always 4.
>
> I would go one step further and throw a warning if a note section is not
> a multiple of 4.
>
> Joerg
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171030/e4055877/attachment.html>


More information about the llvm-commits mailing list