[lld] [LLD][COFF] Add -build-id flag to generate .buildid section. (PR #71433)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 12:13:00 PST 2023


mstorsjo wrote:

> At the source that references `__lld_buildid`, it can use `extern "C" __declspec(selectany) uint8_t __lld_buildid[24];` to read the build id.

Ah, this was the bit I was missing. Yes, in that case it should be quite straightforward - I thought of how to read it from outside of the binary.

> For tools like `llvm-readobj`, it is already able to read build id even if it's inside `.rdata` by looking through the program header.

Indeed, from outside of the process, the current approach should be fine.


https://github.com/llvm/llvm-project/pull/71433


More information about the llvm-commits mailing list