[PATCH] D18091: ELF: Implement --build-id.

Ed Maste via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 12:38:44 PST 2016


emaste added a comment.

> Does it have to be in the first page of a binary?


From https://fedoraproject.org/wiki/Releases/FeatureBuildId:
The build ID note is normally near the beginning of the image and will be in the first page unless there are an unreasonable number of phdrs or other notes. (The kernel should not deal with anything more complex than a simple rule like the first page, so the odd binary with its notes in the wrong places will just lose.)

It is preferred, but not required. And for matching debug files at least it won't matter.

In my hello world I see:

  Section Headers:
    [Nr] Name              Type             Address           Offset
         Size              EntSize          Flags  Link  Info  Align
    [ 0]                   NULL             0000000000000000  00000000
         0000000000000000  0000000000000000           0     0     0
    [ 1] .interp           PROGBITS         0000000000010270  00000270
         0000000000000015  0000000000000000   A       0     0     1
    [ 2] .note.tag         NOTE             0000000000010288  00000288
         0000000000000030  0000000000000000   A       0     0     4
    [ 3] .rodata           PROGBITS         00000000000102b8  000002b8
         0000000000000001  0000000000000000 AMS       0     0     1
    [ 4] .eh_frame         X86_64_UNWIND    00000000000102c0  000002c0
         0000000000000080  0000000000000000   A       0     0     8
    [ 5] .rodata           PROGBITS         0000000000010340  00000340
         000000000000000f  0000000000000000   A       0     0     1
    [ 6] .note.gnu.build-i NOTE             000000000001034f  0000034f
         0000000000000018  0000000000000000   A       0     0     0

and it seems like we should move it immediately after .note.tag.


http://reviews.llvm.org/D18091





More information about the llvm-commits mailing list