What is NT_GNU_BUILD_ID used for?

I read the golang ld manual , and one of the options:

-B value
    Add a NT_GNU_BUILD_ID note when using ELF.  The value
    should start with 0x and be an even number of hex digits.

Does anyone know why to use this flag?

the search NT_GNU_BUILD_IDgives no insightful answer.

+4
source share
1 answer

This comes from a massive conversion from C to Gocmd/new5l (February 2015), translated fromsrc/cmd/ld/pobj.c

This information was presented in commit 7d507dc6e (December 2013 for Go 1.3), preparing for a new linker layout.

NT_GNU_BUILD_ID .
, , ,
Fedora

.debug, ELF.
strip . , SHT_NOTE.

.note.gnu.build-id, , SHT_NOTE.
ELF "GNU" 3 (NT_GNU_BUILD_ID) , ( ET_REL .ko),.

2007 :

ld ELF, --build-id.
ELF, "unique build ID" ld.

ld, , (vs some script ).
, , ELF- , .

, (.. ) .

+4

Source: https://habr.com/ru/post/1584568/


All Articles