aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-03-14 12:57:09 +0000
committerNick Clifton <nickc@redhat.com>2017-03-14 12:57:09 +0000
commitc799a79d66d09c442d85467986c2e8873f09297c (patch)
tree2965d196134777e2ac1c46bd64acf31eea9e150d /binutils/testsuite
parent0efcde634d45f4cda03fd18c43ff449103559d7a (diff)
downloadgdb-c799a79d66d09c442d85467986c2e8873f09297c.zip
gdb-c799a79d66d09c442d85467986c2e8873f09297c.tar.gz
gdb-c799a79d66d09c442d85467986c2e8873f09297c.tar.bz2
Try harder to find the correct symbol to associate with OPEN GNU BUILD notes.
* readelf.c (print_gnu_build_attribute_description): Move symbol printing code to... (print_symbol_for_build_attribute): New function. ...here. Add to find the best symbol to associate with an OPEN note. Add code to cache the symbol table and string table, so that they are not loaded every time a note is displayed. * testsuite/binutils-all/note-2-32.s: Add a function symbol. * testsuite/binutils-all/note-2-64.s: Likewise. * testsuite/binutils-all/note-2-32.d: Update expected note output. * testsuite/binutils-all/note-2-64.d: Likewise.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/binutils-all/note-2-32.d2
-rw-r--r--binutils/testsuite/binutils-all/note-2-32.s2
-rw-r--r--binutils/testsuite/binutils-all/note-2-64.d2
-rw-r--r--binutils/testsuite/binutils-all/note-2-64.s5
4 files changed, 8 insertions, 3 deletions
diff --git a/binutils/testsuite/binutils-all/note-2-32.d b/binutils/testsuite/binutils-all/note-2-32.d
index 0c0974c..8deb7f6 100644
--- a/binutils/testsuite/binutils-all/note-2-32.d
+++ b/binutils/testsuite/binutils-all/note-2-32.d
@@ -13,5 +13,5 @@
[ ]+\*<ABI>0x0[ ]+0x00000000[ ]+NT_GNU_BUILD_ATTRIBUTE_OPEN[ ]+Applies from offset 0x100
[ ]+\$<version>1[ ]+0x00000004[ ]+NT_GNU_BUILD_ATTRIBUTE_OPEN[ ]+Applies from offset 0x10. \(file: note2.s\)
[ ]+!<stack prot>false[ ]+0x00000000[ ]+NT_GNU_BUILD_ATTRIBUTE_OPEN[ ]+Applies from offset 0x10.
-[ ]+\*<PIC>pic[ ]+0x00000000[ ]+NT_GNU_BUILD_ATTRIBUTE_FUNC[ ]+Applies from offset 0x10.
+[ ]+\*<PIC>pic[ ]+0x00000000[ ]+NT_GNU_BUILD_ATTRIBUTE_FUNC[ ]+Applies to func at 0x10. \(func: func1\)
#...
diff --git a/binutils/testsuite/binutils-all/note-2-32.s b/binutils/testsuite/binutils-all/note-2-32.s
index 8d9f53a..da3b085 100644
--- a/binutils/testsuite/binutils-all/note-2-32.s
+++ b/binutils/testsuite/binutils-all/note-2-32.s
@@ -39,6 +39,8 @@ note1.s:
.global note2.s
note2.s:
+ .type func1, STT_FUNC
+func1:
.word 0x100
.pushsection .gnu.build.attributes, "0x100000", %note
diff --git a/binutils/testsuite/binutils-all/note-2-64.d b/binutils/testsuite/binutils-all/note-2-64.d
index 3dd4582..8535821 100644
--- a/binutils/testsuite/binutils-all/note-2-64.d
+++ b/binutils/testsuite/binutils-all/note-2-64.d
@@ -13,5 +13,5 @@
[ ]+\*<ABI>0x0[ ]+0x00000000[ ]+NT_GNU_BUILD_ATTRIBUTE_OPEN[ ]+Applies from offset 0x100
[ ]+\$<version>1[ ]+0x00000008[ ]+NT_GNU_BUILD_ATTRIBUTE_OPEN[ ]+Applies from offset 0x10. \(file: note2.s\)
[ ]+!<stack prot>false[ ]+0x00000000[ ]+NT_GNU_BUILD_ATTRIBUTE_OPEN[ ]+Applies from offset 0x10.
-[ ]+\*<PIC>pic[ ]+0x00000000[ ]+NT_GNU_BUILD_ATTRIBUTE_FUNC[ ]+Applies from offset 0x10.
+[ ]+\*<PIC>pic[ ]+0x00000000[ ]+NT_GNU_BUILD_ATTRIBUTE_FUNC[ ]+Applies to func at 0x10. \(func: func1\)
#...
diff --git a/binutils/testsuite/binutils-all/note-2-64.s b/binutils/testsuite/binutils-all/note-2-64.s
index 51317c8..fcd61d0 100644
--- a/binutils/testsuite/binutils-all/note-2-64.s
+++ b/binutils/testsuite/binutils-all/note-2-64.s
@@ -39,8 +39,11 @@ note1.s:
.global note2.s
note2.s:
+ .global func1
+ .type func1, STT_FUNC
+func1:
.word 0x100
-
+
.pushsection .gnu.build.attributes, "0x100000", %note
.dc.l 4
.dc.l 8