[PATCH] D76482: [lld][ELF] Provide optional hidden symbols for build ID

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 22:57:52 PDT 2020


MaskRay added a comment.

In D76482#2183792 <https://reviews.llvm.org/D76482#2183792>, @phosek wrote:

>>> In the latest patch `__build_id_start` and `__build_id_end` point to the payload, not beginning and end of the section, so users don't have to parse the note header, which is what @mcgrathr mentioned in his comment, or is there something else you have in mind? This is also something you cannot replicate with the linker script, with the linker you can point at the beginning and the end of the section, but not the payload.
>>
>> Doesn't my INSERT BEFORE example point the symbols at the beginning and the end of the section? You can use `HIDDEN` or `PROVIDE_HIDDEN` if you want them to be hidden.
>
> We want the opposite though, we want these symbols to point directly at the payload to avoid having to parse the note header.

Is this request a bit too ad-hoc? The header is always 16 bytes (BuildIdSection::headerSize). You can write `PROVIDE_HIDDEN(__buildid_start = . + 16);`


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

https://reviews.llvm.org/D76482



More information about the llvm-commits mailing list