diff options
author | Mark Wielaard <mark@klomp.org> | 2018-11-12 23:34:24 +0100 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2018-11-13 13:46:40 +0100 |
commit | 72e30c2e0cb49a9a300667fdd5ff09082f717950 (patch) | |
tree | d8aa22a90873f98e00df21f33c0ae40c520f0de5 /src/ChangeLog | |
parent | 7a3f6fe60b8519b5372f5a5521ccbac59411f33f (diff) | |
download | elfutils-72e30c2e0cb49a9a300667fdd5ff09082f717950.tar.gz |
Handle GNU Build Attribute ELF Notes.
GNU Build Attribute ELF Notes are generated by the GCC annobin plugin
and described at https://fedoraproject.org/wiki/Toolchain/Watermark
Unfortunately the constants aren't yet described in the standard glibc
elf.h so they have been added to the elfutils specific elf-knowledge.h.
The notes abuse the name owner field to encode some data not in the
description. This makes it a bit hard to parse. We have to match the
note owner name prefix (to "GA") to be sure the type is valid. We also
cannot rely on the owner name being a valid C string since the attribute
name and value can contain zero (terminators). So pass around namesz
to the ebl note parsing functions.
eu-elflint will recognize and eu-readelf -n will now show the notes:
Note section [27] '.gnu.build.attributes' of 56080 bytes at offset 0x114564:
Owner Data size Type
GA 16 GNU Build Attribute OPEN
Address Range: 0x2f30f - 0x2f30f
VERSION: "3p8"
GA 0 GNU Build Attribute OPEN
TOOL: "gcc 8.2.1 20180801"
GA 0 GNU Build Attribute OPEN
"GOW": 45
GA 0 GNU Build Attribute OPEN
STACK_PROT: 0
GA 0 GNU Build Attribute OPEN
"stack_clash": TRUE
GA 0 GNU Build Attribute OPEN
"cf_protection": 0
GA 0 GNU Build Attribute OPEN
"GLIBCXX_ASSERTIONS": TRUE
GA 0 GNU Build Attribute OPEN
"FORTIFY": 0
GA 0 GNU Build Attribute OPEN
PIC: 3
GA 0 GNU Build Attribute OPEN
SHORT_ENUM: FALSE
GA 0 GNU Build Attribute OPEN
ABI: c001100000012
GA 0 GNU Build Attribute OPEN
"stack_realign": FALSE
A new test was added to run-readelf -n for the existing annobin file.
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'src/ChangeLog')
-rw-r--r-- | src/ChangeLog | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0ed86bbf..f014de8f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2018-11-12 Mark Wielaard <mark@klomp.org> + + * elflint.c (check_note_data): Recognize NT_GNU_BUILD_ATTRIBUTE_OPEN + and NT_GNU_BUILD_ATTRIBUTE_OPEN. + * readelf.c (handle_notes_data): Handle + ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX. Pass nhdr.n_namesz to + ebl_object_note. + 2018-11-11 Mark Wielaard <mark@klomp.org> * readelf.c (handle_notes_data): Pass n_descsz to |