PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
Build ID

GNU build ID note inserted by the linker. More...

Data Structures

struct  ElfExternalNote
 ELF note, the format the linker uses to insert the build ID. More...
 

Macros

#define BUILD_ID_EXPECTED_LEN   (20)
 Length of the build ID, a SHA-1 hash.
 
#define BUILD_ID_NAME_EXPECTED_LEN   (4)
 Length of the build ID note name, "GNU" and its terminator.
 
#define BUILD_ID_TOTAL_EXPECTED_LEN    (sizeof(ElfExternalNote) + BUILD_ID_NAME_EXPECTED_LEN + BUILD_ID_EXPECTED_LEN)
 Total size of a build ID note.
 

Functions

bool build_id_contains_gnu_build_id (const ElfExternalNote *note)
 Check whether a note holds a GNU build ID of the expected length.
 

Detailed Description

GNU build ID note inserted by the linker.


Data Structure Documentation

◆ ElfExternalNote

struct ElfExternalNote

ELF note, the format the linker uses to insert the build ID.

Data Fields
uint8_t data[] Name ("GNU" for a build ID) followed by the descriptor.
uint32_t data_length Length of the descriptor (the build ID) in bytes.
uint32_t name_length Length of the name, including its terminator.
uint32_t type Note type, 3 (NT_GNU_BUILD_ID) for a build ID.

Macro Definition Documentation

◆ BUILD_ID_EXPECTED_LEN

#define BUILD_ID_EXPECTED_LEN   (20)

Length of the build ID, a SHA-1 hash.

◆ BUILD_ID_NAME_EXPECTED_LEN

#define BUILD_ID_NAME_EXPECTED_LEN   (4)

Length of the build ID note name, "GNU" and its terminator.

◆ BUILD_ID_TOTAL_EXPECTED_LEN

#define BUILD_ID_TOTAL_EXPECTED_LEN    (sizeof(ElfExternalNote) + BUILD_ID_NAME_EXPECTED_LEN + BUILD_ID_EXPECTED_LEN)

Total size of a build ID note.

Function Documentation

◆ build_id_contains_gnu_build_id()

bool build_id_contains_gnu_build_id ( const ElfExternalNote *  note)

Check whether a note holds a GNU build ID of the expected length.

Parameters
noteELF note.
Returns
true if note is a 20-byte NT_GNU_BUILD_ID note named "GNU".