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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 02:09:21 PDT 2019


MaskRay added a comment.

In D59531#1493064 <https://reviews.llvm.org/D59531#1493064>, @ruiu wrote:

> This thread is long and we might have discussed this, but have you considered sorting .note sections by alignment? *If* the size of a .note section with 8 bytes alignment is always a multiple of 8 (not sure if that's true), sorting .note sections might be able to fix the issue.


The thread is long, and there is another long thread in the gnu-abi mailing list :) I tried summarizing their points in my previous comment and in my commit description.

Someone suggested interpreting notes as `Elf64_Word n_namesz, n_descsz, n_type;` or `Elf64_Xword n_namesz, n_descsz, n_type;` according to `p_align`. The former is for compatibility while the latter is for gABI conformance. (It is very bad that since 2015 nobody maintains gABI.) This interpretation makes it fundamentally impossible to mix 4-byte aligned and 8-byte aligned notes in one PT_NOTE segment. The section header is not read by many consumers.


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

https://reviews.llvm.org/D59531





More information about the llvm-commits mailing list