[PATCH] D59531: [ELF] Produce multiple PT_NOTE segments as needed

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 1 20:48:26 PDT 2019


ruiu added a comment.

In D59531#1445628 <https://reviews.llvm.org/D59531#1445628>, @grimar wrote:

> In D59531#1445429 <https://reviews.llvm.org/D59531#1445429>, @ruiu wrote:
>
> > Hmm, if some tools are setting a large alignment (greater than 4) to a .note section by mistake, then we probably should ignore them and treat them as a 4 byte alignment rather than respecting a wrong value. That means always setting alignment of 4 to every .note input section.
>
>
> Sounds a bit hacky IMO. I would expect from linker to make as fewer assumptions as possible.
>
> I.e. if some tool "setting a large alignment (greater than 4) to a .note section by mistake",
>  I would expect we would at least report a warning before adjusting the alignment?
>  And ideally the tool needs to be fixed and we then will remove that temporary workaround from the linker after some time.


I don't agree. I feel like we are worrying too much about unrealistic scenario. The reality is that some tool accidentally sets 8 bytes alignment to a .note section while they should have been 4 bytes. Since it is a .note section, no one that reads the section care whether it was aligned to 8 bytes or 4 bytes. We could make up a scenario in which a .note alignment matters, but I'd think that's probably a pathetic use case (and probably an inappropriate use of the section.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59531/new/

https://reviews.llvm.org/D59531





More information about the llvm-commits mailing list