aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@arm.com>2017-01-20 13:30:32 +0000
committerJiong Wang <jiong.wang@arm.com>2017-01-20 13:30:32 +0000
commit7f784814df7067396e9c00b5cdc0eff9cd5c68de (patch)
tree56139f5bfeca324ddefe8c90ad921cc617e8ef9c /ld
parentadd3afb219e755e13f4ec1c91aa59223df31a965 (diff)
downloadgdb-7f784814df7067396e9c00b5cdc0eff9cd5c68de.zip
gdb-7f784814df7067396e9c00b5cdc0eff9cd5c68de.tar.gz
gdb-7f784814df7067396e9c00b5cdc0eff9cd5c68de.tar.bz2
[AArch64] Optimize .gnu.hash table size for executable
bfd/ * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function. (elf_backend_hash_symbol): Define. ld/ * testsuite/ld-aarch64/aarch64-elf.exp (aarch64elflinktests): New tests. * testsuite/ld-aarch64/func-in-so.s: New test source file. * testsuite/ld-aarch64/func-sym-hash-opt.s: Likewise. * testsuite/ld-aarch64/func-sym-hash-opt.d: New expected test result.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/testsuite/ld-aarch64/aarch64-elf.exp5
-rw-r--r--ld/testsuite/ld-aarch64/func-in-so.s6
-rw-r--r--ld/testsuite/ld-aarch64/func-sym-hash-opt.d6
-rw-r--r--ld/testsuite/ld-aarch64/func-sym-hash-opt.s7
5 files changed, 31 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 6e77d00..c710222 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2017-01-20 Jiong Wang <jiong.wang@arm.com>
+
+ * testsuite/ld-aarch64/aarch64-elf.exp (aarch64elflinktests): New tests.
+ * testsuite/ld-aarch64/func-in-so.s: New test source file.
+ * testsuite/ld-aarch64/func-sym-hash-opt.s: Likewise.
+ * testsuite/ld-aarch64/func-sym-hash-opt.d: New expected test result.
+
2017-01-20 Andrew Burgess <andrew.burgess@embecosm.com>
* testsuite/ld-elf/eh-frame-hdr.d: Update expected results.
diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp
index 0900267..f77b169 100644
--- a/ld/testsuite/ld-aarch64/aarch64-elf.exp
+++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp
@@ -323,6 +323,11 @@ set aarch64elflinktests {
{} "copy-reloc-so.so"}
{"ld-aarch64/exe with copy relocation" "-e0 tmpdir/copy-reloc-so.so" "" ""
{copy-reloc-exe.s} {{objdump -R copy-reloc.d}} "copy-reloc"}
+ {"ld-aarch64/so with global func" "-shared" "" "" {func-in-so.s}
+ {} "func-in-so.so"}
+ {"ld-aarch64/func sym hash opt for exe"
+ "-e0 --hash-style=gnu tmpdir/func-in-so.so" "" ""
+ {func-sym-hash-opt.s} {{readelf --dyn-sym func-sym-hash-opt.d}} "hash-opt"}
}
run_ld_link_tests $aarch64elflinktests
diff --git a/ld/testsuite/ld-aarch64/func-in-so.s b/ld/testsuite/ld-aarch64/func-in-so.s
new file mode 100644
index 0000000..608eead
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/func-in-so.s
@@ -0,0 +1,6 @@
+ .text
+ .align 2
+ .global dec
+ .type dec, %function
+dec:
+ ret
diff --git a/ld/testsuite/ld-aarch64/func-sym-hash-opt.d b/ld/testsuite/ld-aarch64/func-sym-hash-opt.d
new file mode 100644
index 0000000..8ffeb00
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/func-sym-hash-opt.d
@@ -0,0 +1,6 @@
+
+Symbol table '.dynsym' contains .* entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 0000000000000000 0 FUNC GLOBAL DEFAULT UND dec
+#...
diff --git a/ld/testsuite/ld-aarch64/func-sym-hash-opt.s b/ld/testsuite/ld-aarch64/func-sym-hash-opt.s
new file mode 100644
index 0000000..70f8f8e
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/func-sym-hash-opt.s
@@ -0,0 +1,7 @@
+ .text
+ .align 2
+ .global main
+ .type main, %function
+main:
+ bl dec
+ ret