aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-04-13 14:50:56 +0100
committerNick Clifton <nickc@redhat.com>2017-04-13 14:50:56 +0100
commit1d15e434f43bc41a07bc7b0648fcb7e6ccbe8dcc (patch)
tree10119cf7d59def56d48feef65ee75321f96f9fe9 /binutils/readelf.c
parent4274208406762da7af6dd697f44d8e6895061530 (diff)
downloadgdb-1d15e434f43bc41a07bc7b0648fcb7e6ccbe8dcc.zip
gdb-1d15e434f43bc41a07bc7b0648fcb7e6ccbe8dcc.tar.gz
gdb-1d15e434f43bc41a07bc7b0648fcb7e6ccbe8dcc.tar.bz2
Add note merging to strip and add code to merge stack size notes.
* objcopy.c: Add --no-merge-notes option to disable note merging. Add --[no-]merge-notes option to strip, and enable it by default. (num_bytes): New function. (merge_gnu_build_notes): Add code to merge stack size notes. * binutils.texi: Update strip and objcopy documentation. * readelf.c (print_gnu_build_attribute_name): Use defined constants for note types.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index d2b8dd4..93b9402 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -16809,9 +16809,12 @@ print_gnu_build_attribute_description (Elf_Internal_Note * pnote,
static bfd_boolean
print_gnu_build_attribute_name (Elf_Internal_Note * pnote)
{
+ static const char string_expected [2] = { GNU_BUILD_ATTRIBUTE_TYPE_STRING, 0 };
+ static const char number_expected [2] = { GNU_BUILD_ATTRIBUTE_TYPE_NUMERIC, 0 };
+ static const char bool_expected [3] = { GNU_BUILD_ATTRIBUTE_TYPE_BOOL_TRUE, GNU_BUILD_ATTRIBUTE_TYPE_BOOL_FALSE, 0 };
char name_type;
char name_attribute;
- char * expected_types;
+ const char * expected_types;
const char * name = pnote->namedata;
const char * text;
int left;
@@ -16845,7 +16848,7 @@ print_gnu_build_attribute_name (Elf_Internal_Note * pnote)
{
case GNU_BUILD_ATTRIBUTE_VERSION:
text = _("<version>");
- expected_types = "$";
+ expected_types = string_expected;
++ name;
break;
case GNU_BUILD_ATTRIBUTE_STACK_PROT:
@@ -16855,17 +16858,17 @@ print_gnu_build_attribute_name (Elf_Internal_Note * pnote)
break;
case GNU_BUILD_ATTRIBUTE_RELRO:
text = _("<relro>");
- expected_types = "!+";
+ expected_types = bool_expected;
++ name;
break;
case GNU_BUILD_ATTRIBUTE_STACK_SIZE:
text = _("<stack size>");
- expected_types = "*";
+ expected_types = number_expected;
++ name;
break;
case GNU_BUILD_ATTRIBUTE_TOOL:
text = _("<tool>");
- expected_types = "$";
+ expected_types = string_expected;
++ name;
break;
case GNU_BUILD_ATTRIBUTE_ABI:
@@ -16875,12 +16878,12 @@ print_gnu_build_attribute_name (Elf_Internal_Note * pnote)
break;
case GNU_BUILD_ATTRIBUTE_PIC:
text = _("<PIC>");
- expected_types = "*";
+ expected_types = number_expected;
++ name;
break;
case GNU_BUILD_ATTRIBUTE_SHORT_ENUM:
text = _("<short enum>");
- expected_types = "!+";
+ expected_types = bool_expected;
++ name;
break;