Add support for elf properties section.
authorMikhail Kashkarov <m.kashkarov@partner.samsung.com>
Mon, 17 Oct 2016 14:29:43 +0000 (15:29 +0100)
committerMikhail Kashkarov <m.kashkarov@partner.samsung.com>
Thu, 18 Jul 2019 11:22:04 +0000 (14:22 +0300)
commit61fbc1aa06ace2eedead83c4526b06941a1d33bb
tree1e484e3982c289389b367310379eea5b09697bf7
parent40f49e4e46624bc012324a50753336f7f9c238e7
Add support for elf properties section.

This is a set of the following backports/cherry-picks to support
.note.gnu.property section.

- Display unknown notes.  Decode NT_GNU_HWCAP notes.
- Add support for displaying and merging GNU_BUILD_NOTEs.
- Fix snafu parsing GNU_BUILD_NOTEs on ARM and AArch64 architectures.
- Fix reading numeric values from GNU BUILD NOTEs.
- Properly dump NT_GNU_PROPERTY_TYPE_0
- Try harder to find the correct symbol to associate with OPEN GNU BUILD notes.
- Add support for a GNU BUILD note type to record the enum size.
- Update support for GNU BUILD notes so that version notes can contain extra information, and stack protection notes can contain numeric values.
- Add note merging to strip and add code to merge stack size notes.
- Fix shift overflow when parsing an overlarge note value.
- Improve decoding of corrupt/unrecognised gnu build attribute notes.
- Fix off by one error when checking for empty note names.
- Add support for version 2 of the GNU Build Attribute note specification.
- Add test of V2 GNU build attribute notes.
- Always pass a valid section header offset to elf_parse_notes
- Re-apply "elf: Properly compute offsets of note descriptor and next note"
- Work around integer overflows when readelf is checking for corrupt ELF notes when run on a 32-bit host.
- Fix a seg-fault when displaying notes from a prorgam segment.  Check for a NULL string section before attempting compute the name of a separate debug info file.
- Properly handle note sections and segments
- ld: Support ELF GNU program properties
- merge_gnu_build_notes reloc deletion
- Add support for v3 binary annotation notes.
- Fix displaying the value associated a GNU BUILD note that uses an ascii name.
- Combine ,gnu.build.attributes.* sections into one .gnu.build.attributes section during linking.
- Improve readelf's selection of a file start symbol when displaying a gnu build attribute.

Change-Id: I7d828cfcc17eda6dcbfe6967e2f26b4d67238406

SHA's:

1449284bd80db7bb4cbe7fef21e1e8b753135af6
9ef920e933bf2ea228c909cf81636e6d9577e51e
c871dadee1817d4b9f3ba6ee792730c9eccf88e0
79a964dca572024447adf92e50959dc88aa4f27a
1fc87489b40b3100badf184a7c266387bae47def
c799a79d66d09c442d85467986c2e8873f09297c
a8be5506b626a57f84771c5ddfaefabf2d61c017
75d7d2986cf896fac8f0690db68ebc552e0b0339
1d15e434f43bc41a07bc7b0648fcb7e6ccbe8dcc
ddef72cdc10d82ba011a7ff81cafbbd3466acf54
3e6b644558f941d3fe482e15efbc53d8f39ef8b7
b06b2c92c06cf100f259f218337d007ee0b1c884
88305e1b9f4592a2ab129015ce409fcc16613ebb
714da62f64ef5527a22a3e897f7e21f69e442ade
08698b7b46c9c932530dcbcd7e851d27a7d2c503
276da9b31bd6e3eb8d1dd814c867266f59f29093
6ab2c4ed51f9c4243691755e1b1d2149c6a426f4
4dff97b2ce94bbb9c0c16e0e4129060b9a894f13
82ed9683ec099d8205dc499ac84febc975235af6
46bed6796d5821832e8ba373ddb2e7fdc45a109d
ee7e95efb98186c09dc2c39b32263aa15b147bb0
6f156d7a4ad1c245b357dc50f63f3564d397839e
0dd6ae21da832f351a3722d2f8bac187fc3bdfef
7d8a31665739412395f6dd370d2279acd322e78e
8fd75781892c7458702f72b3b9cb1927609716de

Change-Id: I7b201b6c0776c3a7e7e25cdbbb937170da244405
85 files changed:
ChangeLog
bfd/ChangeLog
bfd/Makefile.am
bfd/Makefile.in
bfd/configure
bfd/configure.ac
bfd/elf-bfd.h
bfd/elf-properties.c [new file with mode: 0644]
bfd/elf.c
bfd/elf32-i386.c
bfd/elf64-x86-64.c
bfd/elfxx-target.h
binutils/ChangeLog
binutils/NEWS
binutils/doc/binutils.texi
binutils/objcopy.c
binutils/readelf.c
binutils/testsuite/binutils-all/i386/pr21231a.d [new file with mode: 0644]
binutils/testsuite/binutils-all/i386/pr21231a.s [new file with mode: 0644]
binutils/testsuite/binutils-all/i386/pr21231b.d [new file with mode: 0644]
binutils/testsuite/binutils-all/i386/pr21231b.s [new file with mode: 0644]
binutils/testsuite/binutils-all/note-2-32.d [new file with mode: 0644]
binutils/testsuite/binutils-all/note-2-32.s [new file with mode: 0644]
binutils/testsuite/binutils-all/note-2-64.d [new file with mode: 0644]
binutils/testsuite/binutils-all/note-2-64.s [new file with mode: 0644]
binutils/testsuite/binutils-all/note-3-32.d [new file with mode: 0644]
binutils/testsuite/binutils-all/note-3-32.s [new file with mode: 0644]
binutils/testsuite/binutils-all/note-3-64.d [new file with mode: 0644]
binutils/testsuite/binutils-all/note-3-64.s [new file with mode: 0644]
binutils/testsuite/binutils-all/note-3.32.s [new file with mode: 0644]
binutils/testsuite/binutils-all/note-4-32.d [new file with mode: 0644]
binutils/testsuite/binutils-all/note-4-32.s [new file with mode: 0644]
binutils/testsuite/binutils-all/note-4-64.d [new file with mode: 0644]
binutils/testsuite/binutils-all/note-4-64.s [new file with mode: 0644]
binutils/testsuite/binutils-all/objcopy.exp
binutils/testsuite/binutils-all/readelf.n
binutils/testsuite/binutils-all/x86-64/pr21231a.d [new file with mode: 0644]
binutils/testsuite/binutils-all/x86-64/pr21231a.s [new file with mode: 0644]
binutils/testsuite/binutils-all/x86-64/pr21231b.d [new file with mode: 0644]
binutils/testsuite/binutils-all/x86-64/pr21231b.s [new file with mode: 0644]
gold/ChangeLog
gold/layout.cc
include/ChangeLog
include/elf/common.h
include/elf/external.h
ld/ChangeLog
ld/NEWS
ld/emultempl/elf32.em
ld/scripttempl/elf.sc
ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-i386/pass.c [new file with mode: 0644]
ld/testsuite/ld-i386/property-1.r [new file with mode: 0644]
ld/testsuite/ld-i386/property-2.r [new file with mode: 0644]
ld/testsuite/ld-i386/property-3.r [new file with mode: 0644]
ld/testsuite/ld-i386/property-4.r [new file with mode: 0644]
ld/testsuite/ld-i386/property-5.r [new file with mode: 0644]
ld/testsuite/ld-i386/property-6.r [new file with mode: 0644]
ld/testsuite/ld-i386/property-6a.c [new file with mode: 0644]
ld/testsuite/ld-i386/property-6b.c [new file with mode: 0644]
ld/testsuite/ld-i386/property-6c.S [new file with mode: 0644]
ld/testsuite/ld-i386/property-7.r [new file with mode: 0644]
ld/testsuite/ld-i386/property-no-copy.S [new file with mode: 0644]
ld/testsuite/ld-i386/property-stack.S [new file with mode: 0644]
ld/testsuite/ld-i386/property-unsorted-1.S [new file with mode: 0644]
ld/testsuite/ld-i386/property-unsorted-2.S [new file with mode: 0644]
ld/testsuite/ld-i386/property-x86-1.S [new file with mode: 0644]
ld/testsuite/ld-i386/property-x86-2.S [new file with mode: 0644]
ld/testsuite/ld-x86-64/pass.c [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-1.r [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-2.r [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-3.r [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-4.r [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-5.r [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-6.r [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-6a.c [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-6b.c [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-6c.S [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-7.r [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-no-copy.S [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-stack.S [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-unsorted-1.S [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-unsorted-2.S [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-x86-1.S [new file with mode: 0644]
ld/testsuite/ld-x86-64/property-x86-2.S [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp