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

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 22:25:05 PDT 2020


phosek added a comment.

In D76482#2183730 <https://reviews.llvm.org/D76482#2183730>, @MaskRay wrote:

> In D76482#2182368 <https://reviews.llvm.org/D76482#2182368>, @phosek wrote:
>
>> I have updated the patch to introduce a pair of `__build_id_start` and `__build_id_end` which point at the beginning and the end of the payload so users of these symbols don't need to parse the note headers which simplifies usage.
>
> @mcgrathr's comment https://reviews.llvm.org/D76482#1934097 has not been addressed. I think you can achieve your goal without any new code:
>
>   SECTIONS {
>     .note.gnu.build-id : {
>       __start_note_gnu_build_id = .;
>       *(.note.gnu.build-id)
>       __stop_note_gnu_build_id = .;
>     }
>   } INSERT BEFORE .dynsym;
>
> INSERT BEFORE|AFTER is special. They are not considered an external linker script (ld.bfd -T a.x --verbose).
>
> If you still want to go down this route, I hope we can see an attempt to sell this idea on binutils side.

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.


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

https://reviews.llvm.org/D76482



More information about the llvm-commits mailing list