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

Zequan Wu via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 16:16:19 PST 2023


ZequanWu wrote:

1. I feel like it's not necessary to create a separate `.buildid` section at all when not using MinGW driver. Initially, I thought if I want to find build id at runtime, I need to somehow find the program header and locate `.buildid`. With a separate section, it's easier to find it. @rnk suggested adding a synthetic `__lld_buildid` symbol to lld-link pointing to the chunk, so it's easier to locate it. I have a local patch for it. With that, it doesn't matter if buildid is in a separate section or not. So, I think just always put it in .rdata under non-MinGW mode is enough. 
2. Maybe GUID is a better name for the flag option and variable (`__lld_guid`?), etc? Build id is a term commonly used in ELF.


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


More information about the llvm-commits mailing list