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

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 13:53:18 PST 2023


================
@@ -1069,6 +1069,16 @@ void Writer::createMiscChunks() {
     debugInfoSec->addChunk(r.second);
   }
 
+  // If .buildid section was not chosen and /build-id is given, create .buildid
+  // section.
+  if (config->buildID && debugInfoSec != buildidSec) {
+    buildidSec->addChunk(debugDirectory);
----------------
mstorsjo wrote:

Hmm, so we'd add the same `Chunk` to two separate `OutputSection`s? Won't that make a mess for things that try to e.g. layout the sections/chunks, when we assign two conflicting addresses for it in two places?

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


More information about the llvm-commits mailing list