summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-arm
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2011-03-14 16:04:03 +0000
committerRichard Sandiford <rsandifo@nildram.co.uk>2011-03-14 16:04:03 +0000
commit740e29179557ee7f74f20228e7fba1d7be68fbba (patch)
tree4b9e53f9c1bf21d1181bf3043238539abbb27341 /ld/testsuite/ld-arm
parent1588e2ae46f9ea24fb533c4b69e8f4033bf76446 (diff)
downloadbinutils-redhat-740e29179557ee7f74f20228e7fba1d7be68fbba.tar.gz
include/elf/
* arm.h (R_ARM_IRELATIVE): New relocation. bfd/ * reloc.c (BFD_RELOC_ARM_IRELATIVE): New relocation. * bfd-in2.h: Regenerate. * elf32-arm.c (elf32_arm_howto_table_2): Rename existing definition to elf32_arm_howto_table_3 and replace with a single R_ARM_IRELATIVE entry. (elf32_arm_howto_from_type): Update accordingly. (elf32_arm_reloc_map): Map BFD_RELOC_ARM_IRELATIVE to R_ARM_IRELATIVE. (elf32_arm_reloc_name_lookup): Handle elf32_arm_howto_table_3. (arm_plt_info): New structure, split out from elf32_arm_link_hash_entry with an extra noncall_refcount field. (arm_local_iplt_info): New structure. (elf_arm_obj_tdata): Add local_iplt. (elf32_arm_local_iplt): New accessor macro. (elf32_arm_link_hash_entry): Replace plt_thumb_refcount, plt_maybe_thumb_refcount and plt_got_offset with an arm_plt_info. Change tls_type to a bitfield and add is_iplt. (elf32_arm_link_hash_newfunc): Update accordingly. (elf32_arm_allocate_local_sym_info): New function. (elf32_arm_create_local_iplt): Likewise. (elf32_arm_get_plt_info): Likewise. (elf32_arm_plt_needs_thumb_stub_p): Likewise. (elf32_arm_get_local_dynreloc_list): Likewise. (create_ifunc_sections): Likewise. (elf32_arm_copy_indirect_symbol): Update after the changes to elf32_arm_link_hash_entry. Assert the is_iplt has not yet been set. (arm_type_of_stub): Add an st_type argument. Use elf32_arm_get_plt_info to get PLT information. Assert that all STT_GNU_IFUNC references are turned into PLT references. (arm_build_one_stub): Pass the symbol type to elf32_arm_final_link_relocate. (elf32_arm_size_stubs): Pass the symbol type to arm_type_of_stub. (elf32_arm_allocate_irelocs): New function. (elf32_arm_add_dynreloc): In static objects, use .rel.iplt for all R_ARM_IRELATIVE. (elf32_arm_allocate_plt_entry): New function. (elf32_arm_populate_plt_entry): Likewise. (elf32_arm_final_link_relocate): Add an st_type parameter. Set srelgot to null for static objects. Use separate variables to record which st_value and st_type should be used when generating a dynamic relocation. Use elf32_arm_get_plt_info to find the symbol's PLT information, setting has_iplt_entry, splt, plt_offset and gotplt_offset accordingly. Check whether STT_GNU_IFUNC symbols should resolve to an .iplt entry, and change the relocation target accordingly. Broaden assert to include .iplts. Don't set sreloc for static relocations. Assert that we only generate dynamic R_ARM_RELATIVE relocations for R_ARM_ABS32 and R_ARM_ABS32_NOI. Generate R_ARM_IRELATIVE relocations instead of R_ARM_RELATIVE relocations if the target is an STT_GNU_IFUNC symbol. Pass the symbol type to arm_type_of_stub. Conditionally resolve GOT references to the .igot.plt entry. (elf32_arm_relocate_section): Update the call to elf32_arm_final_link_relocate. (elf32_arm_gc_sweep_hook): Use elf32_arm_get_plt_info to get PLT information. Treat R_ARM_REL32 and R_ARM_REL32_NOI as call relocations in shared libraries and relocatable executables. Count non-call PLT references. Use elf32_arm_get_local_dynreloc_list to get the list of dynamic relocations for a local symbol. (elf32_arm_check_relocs): Always create ifunc sections. Set isym at the same time as setting h. Use elf32_arm_allocate_local_sym_info to allocate local symbol information. Treat R_ARM_REL32 and R_ARM_REL32_NOI as call relocations in shared libraries and relocatable executables. Record PLT information for local STT_GNU_IFUNC functions as well as global functions. Count non-call PLT references. Use elf32_arm_get_local_dynreloc_list to get the list of dynamic relocations for a local symbol. (elf32_arm_adjust_dynamic_symbol): Handle STT_GNU_IFUNC symbols. Don't remove STT_GNU_IFUNC PLTs unless all references have been removed. Update after the changes to elf32_arm_link_hash_entry. (allocate_dynrelocs_for_symbol): Decide whether STT_GNU_IFUNC PLT entries should live in .plt or .iplt. Check whether the .igot.plt and .got entries can be combined. Use elf32_arm_allocate_plt_entry to allocate .plt and .(i)got.plt entries. Detect which .got entries will need R_ARM_IRELATIVE relocations and use elf32_arm_allocate_irelocs to allocate them. Likewise other non-.got dynamic relocations. (elf32_arm_size_dynamic_sections): Allocate .iplt, .igot.plt and dynamic relocations for local STT_GNU_IFUNC symbols. Check whether the .igot.plt and .got entries can be combined. Detect which .got entries will need R_ARM_IRELATIVE relocations and use elf32_arm_allocate_irelocs to allocate them. Use stashed section pointers intead of strcmp checks. Handle iplt and igotplt. (elf32_arm_finish_dynamic_symbol): Use elf32_arm_populate_plt_entry to fill in .plt, .got.plt and .rel(a).plt entries. Point STT_GNU_IFUNC symbols at an .iplt entry if non-call relocations resolve to it. (elf32_arm_output_plt_map_1): New function, split out from elf32_arm_output_plt_map. Handle .iplt entries. Use elf32_arm_plt_needs_thumb_stub_p. (elf32_arm_output_plt_map): Call it. (elf32_arm_output_arch_local_syms): Add mapping symbols for local .iplt entries. (elf32_arm_swap_symbol_in): Handle Thumb STT_GNU_IFUNC symbols. (elf32_arm_swap_symbol_out): Likewise. (elf32_arm_add_symbol_hook): New function. (elf_backend_add_symbol_hook): Define for all targets. opcodes/ * arm-dis.c (get_sym_code_type): Treat STT_GNU_IFUNCs as code. gas/ * config/tc-arm.c (md_pcrel_from_section): Use S_FORCE_RELOC to determine whether a relocation is needed. (md_apply_fix, arm_apply_sym_value): Likewise. ld/testsuite/ * ld-arm/ifunc-1.s, ld-arm/ifunc-1.dd, ld-arm/ifunc-1.gd, ld-arm/ifunc-1.rd, ld-arm/ifunc-2.s, ld-arm/ifunc-2.dd, ld-arm/ifunc-2.gd, ld-arm/ifunc-2.rd, ld-arm/ifunc-3.s, ld-arm/ifunc-3.dd, ld-arm/ifunc-3.gd, ld-arm/ifunc-3.rd, ld-arm/ifunc-4.s, ld-arm/ifunc-4.dd, ld-arm/ifunc-4.gd, ld-arm/ifunc-4.rd, ld-arm/ifunc-5.s, ld-arm/ifunc-5.dd, ld-arm/ifunc-5.gd, ld-arm/ifunc-5.rd, ld-arm/ifunc-6.s, ld-arm/ifunc-6.dd, ld-arm/ifunc-6.gd, ld-arm/ifunc-6.rd, ld-arm/ifunc-7.s, ld-arm/ifunc-7.dd, ld-arm/ifunc-7.gd, ld-arm/ifunc-7.rd, ld-arm/ifunc-8.s, ld-arm/ifunc-8.dd, ld-arm/ifunc-8.gd, ld-arm/ifunc-8.rd, ld-arm/ifunc-9.s, ld-arm/ifunc-9.dd, ld-arm/ifunc-9.gd, ld-arm/ifunc-9.rd, ld-arm/ifunc-10.s, ld-arm/ifunc-10.dd, ld-arm/ifunc-10.gd, ld-arm/ifunc-10.rd, ld-arm/ifunc-11.s, ld-arm/ifunc-11.dd, ld-arm/ifunc-11.gd, ld-arm/ifunc-11.rd, ld-arm/ifunc-12.s, ld-arm/ifunc-12.dd, ld-arm/ifunc-12.gd, ld-arm/ifunc-12.rd, ld-arm/ifunc-13.s, ld-arm/ifunc-13.dd, ld-arm/ifunc-13.gd, ld-arm/ifunc-13.rd, ld-arm/ifunc-14.s, ld-arm/ifunc-14.dd, ld-arm/ifunc-14.gd, ld-arm/ifunc-14.rd, ld-arm/ifunc-15.s, ld-arm/ifunc-15.dd, ld-arm/ifunc-15.gd, ld-arm/ifunc-15.rd, ld-arm/ifunc-16.s, ld-arm/ifunc-16.dd, ld-arm/ifunc-16.gd, ld-arm/ifunc-16.rd, ld-arm/ifunc-dynamic.ld, ld-arm/ifunc-static.ld: New tests. * ld-arm/farcall-group.d, ld-arm/farcall-group-size2.d, ld-arm/farcall-mixed-lib-v4t.d, ld-arm/farcall-mixed-lib.d: Update for new stub hashes. * ld-arm/arm-elf.exp: Run them.
Diffstat (limited to 'ld/testsuite/ld-arm')
-rw-r--r--ld/testsuite/ld-arm/arm-elf.exp82
-rw-r--r--ld/testsuite/ld-arm/farcall-group-size2.d16
-rw-r--r--ld/testsuite/ld-arm/farcall-group.d42
-rw-r--r--ld/testsuite/ld-arm/farcall-mixed-lib-v4t.d16
-rw-r--r--ld/testsuite/ld-arm/farcall-mixed-lib.d16
-rw-r--r--ld/testsuite/ld-arm/ifunc-1.dd139
-rw-r--r--ld/testsuite/ld-arm/ifunc-1.gd29
-rw-r--r--ld/testsuite/ld-arm/ifunc-1.rd8
-rw-r--r--ld/testsuite/ld-arm/ifunc-1.s48
-rw-r--r--ld/testsuite/ld-arm/ifunc-10.dd951
-rw-r--r--ld/testsuite/ld-arm/ifunc-10.gd188
-rw-r--r--ld/testsuite/ld-arm/ifunc-10.rd42
-rw-r--r--ld/testsuite/ld-arm/ifunc-10.s90
-rw-r--r--ld/testsuite/ld-arm/ifunc-11.dd95
-rw-r--r--ld/testsuite/ld-arm/ifunc-11.gd29
-rw-r--r--ld/testsuite/ld-arm/ifunc-11.rd11
-rw-r--r--ld/testsuite/ld-arm/ifunc-11.s52
-rw-r--r--ld/testsuite/ld-arm/ifunc-12.dd95
-rw-r--r--ld/testsuite/ld-arm/ifunc-12.gd39
-rw-r--r--ld/testsuite/ld-arm/ifunc-12.rd19
-rw-r--r--ld/testsuite/ld-arm/ifunc-12.s58
-rw-r--r--ld/testsuite/ld-arm/ifunc-13.dd89
-rw-r--r--ld/testsuite/ld-arm/ifunc-13.gd29
-rw-r--r--ld/testsuite/ld-arm/ifunc-13.rd9
-rw-r--r--ld/testsuite/ld-arm/ifunc-13.s50
-rw-r--r--ld/testsuite/ld-arm/ifunc-14.dd100
-rw-r--r--ld/testsuite/ld-arm/ifunc-14.gd27
-rw-r--r--ld/testsuite/ld-arm/ifunc-14.rd12
-rw-r--r--ld/testsuite/ld-arm/ifunc-14.s47
-rw-r--r--ld/testsuite/ld-arm/ifunc-15.dd100
-rw-r--r--ld/testsuite/ld-arm/ifunc-15.gd27
-rw-r--r--ld/testsuite/ld-arm/ifunc-15.rd12
-rw-r--r--ld/testsuite/ld-arm/ifunc-15.s47
-rw-r--r--ld/testsuite/ld-arm/ifunc-16.dd88
-rw-r--r--ld/testsuite/ld-arm/ifunc-16.gd27
-rw-r--r--ld/testsuite/ld-arm/ifunc-16.rd9
-rw-r--r--ld/testsuite/ld-arm/ifunc-16.s49
-rw-r--r--ld/testsuite/ld-arm/ifunc-2.dd445
-rw-r--r--ld/testsuite/ld-arm/ifunc-2.gd48
-rw-r--r--ld/testsuite/ld-arm/ifunc-2.rd13
-rw-r--r--ld/testsuite/ld-arm/ifunc-2.s74
-rw-r--r--ld/testsuite/ld-arm/ifunc-3.dd126
-rw-r--r--ld/testsuite/ld-arm/ifunc-3.gd45
-rw-r--r--ld/testsuite/ld-arm/ifunc-3.rd20
-rw-r--r--ld/testsuite/ld-arm/ifunc-3.s49
-rw-r--r--ld/testsuite/ld-arm/ifunc-4.dd1055
-rw-r--r--ld/testsuite/ld-arm/ifunc-4.gd167
-rw-r--r--ld/testsuite/ld-arm/ifunc-4.rd74
-rw-r--r--ld/testsuite/ld-arm/ifunc-4.s95
-rw-r--r--ld/testsuite/ld-arm/ifunc-5.dd91
-rw-r--r--ld/testsuite/ld-arm/ifunc-5.gd23
-rw-r--r--ld/testsuite/ld-arm/ifunc-5.rd8
-rw-r--r--ld/testsuite/ld-arm/ifunc-5.s39
-rw-r--r--ld/testsuite/ld-arm/ifunc-6.dd175
-rw-r--r--ld/testsuite/ld-arm/ifunc-6.gd27
-rw-r--r--ld/testsuite/ld-arm/ifunc-6.rd9
-rw-r--r--ld/testsuite/ld-arm/ifunc-6.s59
-rw-r--r--ld/testsuite/ld-arm/ifunc-7.dd120
-rw-r--r--ld/testsuite/ld-arm/ifunc-7.gd45
-rw-r--r--ld/testsuite/ld-arm/ifunc-7.rd21
-rw-r--r--ld/testsuite/ld-arm/ifunc-7.s42
-rw-r--r--ld/testsuite/ld-arm/ifunc-8.dd1017
-rw-r--r--ld/testsuite/ld-arm/ifunc-8.gd167
-rw-r--r--ld/testsuite/ld-arm/ifunc-8.rd80
-rw-r--r--ld/testsuite/ld-arm/ifunc-8.s88
-rw-r--r--ld/testsuite/ld-arm/ifunc-9.dd154
-rw-r--r--ld/testsuite/ld-arm/ifunc-9.gd29
-rw-r--r--ld/testsuite/ld-arm/ifunc-9.rd10
-rw-r--r--ld/testsuite/ld-arm/ifunc-9.s44
-rw-r--r--ld/testsuite/ld-arm/ifunc-dynamic.ld33
-rw-r--r--ld/testsuite/ld-arm/ifunc-static.ld21
71 files changed, 7255 insertions, 45 deletions
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
index 11ee5759af..5b50da507d 100644
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -311,6 +311,88 @@ set armelftests {
"" {exec-got-1b.s}
{{readelf --relocs exec-got-1.d}}
"exec-got-1"}
+ {"IFUNC test 1" "-T ifunc-static.ld" "" {ifunc-1.s}
+ {{objdump -d ifunc-1.dd}
+ {objdump {-s -j.data -j.got} ifunc-1.gd}
+ {readelf -dr ifunc-1.rd}}
+ "ifunc-1"}
+ {"IFUNC test 2" "-T ifunc-static.ld" "" {ifunc-2.s}
+ {{objdump -d ifunc-2.dd}
+ {objdump {-s -j.data -j.got} ifunc-2.gd}
+ {readelf -dr ifunc-2.rd}}
+ "ifunc-2"}
+ {"IFUNC test 3" "-T ifunc-dynamic.ld -shared" "" {ifunc-3.s}
+ {{objdump -d ifunc-3.dd}
+ {objdump {-s -j.data -j.got} ifunc-3.gd}
+ {readelf -r ifunc-3.rd}}
+ "ifunc-3.so"}
+ {"IFUNC test 4" "-T ifunc-dynamic.ld -shared" "" {ifunc-4.s}
+ {{objdump -d ifunc-4.dd}
+ {objdump {-s -j.data -j.got} ifunc-4.gd}
+ {readelf -r ifunc-4.rd}}
+ "ifunc-4.so"}
+ {"IFUNC test 5" "-T ifunc-static.ld" "" {ifunc-5.s}
+ {{objdump -d ifunc-5.dd}
+ {objdump {-s -j.data -j.got} ifunc-5.gd}
+ {readelf -dr ifunc-5.rd}}
+ "ifunc-5"}
+ {"IFUNC test 6" "-T ifunc-static.ld" "" {ifunc-6.s}
+ {{objdump -d ifunc-6.dd}
+ {objdump {-s -j.data -j.got} ifunc-6.gd}
+ {readelf -dr ifunc-6.rd}}
+ "ifunc-6"}
+ {"IFUNC test 7" "-T ifunc-dynamic.ld tmpdir/ifunc-3.so -shared"
+ "" {ifunc-7.s}
+ {{objdump -d ifunc-7.dd}
+ {objdump {-s -j.data -j.got} ifunc-7.gd}
+ {readelf -r ifunc-7.rd}}
+ "ifunc-7.so"}
+ {"IFUNC test 8" "-T ifunc-dynamic.ld tmpdir/ifunc-4.so -shared"
+ "" {ifunc-8.s}
+ {{objdump -d ifunc-8.dd}
+ {objdump {-s -j.data -j.got} ifunc-8.gd}
+ {readelf -r ifunc-8.rd}}
+ "ifunc-8.so"}
+ {"IFUNC test 9" "-T ifunc-dynamic.ld tmpdir/ifunc-3.so" "" {ifunc-9.s}
+ {{objdump -d ifunc-9.dd}
+ {objdump {-s -j.data -j.got} ifunc-9.gd}
+ {readelf -r ifunc-9.rd}}
+ "ifunc-9"}
+ {"IFUNC test 10" "-T ifunc-dynamic.ld tmpdir/ifunc-4.so" "" {ifunc-10.s}
+ {{objdump -d ifunc-10.dd}
+ {objdump {-s -j.data -j.got} ifunc-10.gd}
+ {readelf -r ifunc-10.rd}}
+ "ifunc-10"}
+ {"IFUNC test 11" "-T ifunc-static.ld" "" {ifunc-11.s}
+ {{objdump -d ifunc-11.dd}
+ {objdump {-s -j.data -j.got} ifunc-11.gd}
+ {readelf -dr ifunc-11.rd}}
+ "ifunc-11"}
+ {"IFUNC test 12" "-T ifunc-dynamic.ld -shared" "" {ifunc-12.s}
+ {{objdump -d ifunc-12.dd}
+ {objdump {-s -j.data -j.got} ifunc-12.gd}
+ {readelf -r ifunc-12.rd}}
+ "ifunc-12.so"}
+ {"IFUNC test 13" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" {ifunc-13.s}
+ {{objdump -d ifunc-13.dd}
+ {objdump {-s -j.data -j.got} ifunc-13.gd}
+ {readelf -r ifunc-13.rd}}
+ "ifunc-13"}
+ {"IFUNC test 14" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" {ifunc-14.s}
+ {{objdump -d ifunc-14.dd}
+ {objdump {-s -j.data -j.got} ifunc-14.gd}
+ {readelf -r ifunc-14.rd}}
+ "ifunc-14"}
+ {"IFUNC test 15" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" {ifunc-15.s}
+ {{objdump -d ifunc-15.dd}
+ {objdump {-s -j.data -j.got} ifunc-15.gd}
+ {readelf -r ifunc-15.rd}}
+ "ifunc-15"}
+ {"IFUNC test 16" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" {ifunc-16.s}
+ {{objdump -d ifunc-16.dd}
+ {objdump {-s -j.data -j.got} ifunc-16.gd}
+ {readelf -r ifunc-16.rd}}
+ "ifunc-16"}
}
run_ld_link_tests $armelftests
diff --git a/ld/testsuite/ld-arm/farcall-group-size2.d b/ld/testsuite/ld-arm/farcall-group-size2.d
index 8a35313ea1..8b1f765dce 100644
--- a/ld/testsuite/ld-arm/farcall-group-size2.d
+++ b/ld/testsuite/ld-arm/farcall-group-size2.d
@@ -19,19 +19,19 @@ Disassembly of section .text:
00001020 <myfunc>:
1020: eb000008 bl 1048 <__bar3_veneer>
- 1024: eb000001 bl 1030 <__bar4_from_arm>
- 1028: eb000003 bl 103c <__bar5_from_arm>
+ 1024: eb000004 bl 103c <__bar4_from_arm>
+ 1028: eb000000 bl 1030 <__bar5_from_arm>
102c: 00000000 andeq r0, r0, r0
-00001030 <__bar4_from_arm>:
- 1030: e59fc000 ldr ip, \[pc, #0\] ; 1038 <__bar4_from_arm\+0x8>
+00001030 <__bar5_from_arm>:
+ 1030: e59fc000 ldr ip, \[pc, #0\] ; 1038 <__bar5_from_arm\+0x8>
1034: e12fff1c bx ip
- 1038: 0200302d .word 0x0200302d
+ 1038: 0200302f .word 0x0200302f
-0000103c <__bar5_from_arm>:
- 103c: e59fc000 ldr ip, \[pc, #0\] ; 1044 <__bar5_from_arm\+0x8>
+0000103c <__bar4_from_arm>:
+ 103c: e59fc000 ldr ip, \[pc, #0\] ; 1044 <__bar4_from_arm\+0x8>
1040: e12fff1c bx ip
- 1044: 0200302f .word 0x0200302f
+ 1044: 0200302d .word 0x0200302d
00001048 <__bar3_veneer>:
1048: e51ff004 ldr pc, \[pc, #-4\] ; 104c <__bar3_veneer\+0x4>
diff --git a/ld/testsuite/ld-arm/farcall-group.d b/ld/testsuite/ld-arm/farcall-group.d
index a72c14ffdc..f20b785763 100644
--- a/ld/testsuite/ld-arm/farcall-group.d
+++ b/ld/testsuite/ld-arm/farcall-group.d
@@ -4,37 +4,37 @@
Disassembly of section .text:
00001000 <_start>:
- 1000: eb000009 bl 102c <__bar_from_arm>
- 1004: eb000006 bl 1024 <__bar2_veneer>
+ 1000: eb00000c bl 1038 <__bar_from_arm>
+ 1004: eb00000e bl 1044 <__bar2_veneer>
00001008 <myfunc>:
- 1008: eb00000d bl 1044 <__bar3_veneer>
- 100c: eb000001 bl 1018 <__bar4_from_arm>
- 1010: eb000008 bl 1038 <__bar5_from_arm>
+ 1008: eb000008 bl 1030 <__bar3_veneer>
+ 100c: eb000004 bl 1024 <__bar4_from_arm>
+ 1010: eb000000 bl 1018 <__bar5_from_arm>
1014: 00000000 andeq r0, r0, r0
-00001018 <__bar4_from_arm>:
- 1018: e59fc000 ldr ip, \[pc, #0\] ; 1020 <__bar4_from_arm\+0x8>
+00001018 <__bar5_from_arm>:
+ 1018: e59fc000 ldr ip, \[pc, #0\] ; 1020 <__bar5_from_arm\+0x8>
101c: e12fff1c bx ip
- 1020: 0200302d .word 0x0200302d
+ 1020: 0200302f .word 0x0200302f
-00001024 <__bar2_veneer>:
- 1024: e51ff004 ldr pc, \[pc, #-4\] ; 1028 <__bar2_veneer\+0x4>
- 1028: 02003024 .word 0x02003024
+00001024 <__bar4_from_arm>:
+ 1024: e59fc000 ldr ip, \[pc, #0\] ; 102c <__bar4_from_arm\+0x8>
+ 1028: e12fff1c bx ip
+ 102c: 0200302d .word 0x0200302d
-0000102c <__bar_from_arm>:
- 102c: e59fc000 ldr ip, \[pc, #0\] ; 1034 <__bar_from_arm\+0x8>
- 1030: e12fff1c bx ip
- 1034: 02003021 .word 0x02003021
+00001030 <__bar3_veneer>:
+ 1030: e51ff004 ldr pc, \[pc, #-4\] ; 1034 <__bar3_veneer\+0x4>
+ 1034: 02003028 .word 0x02003028
-00001038 <__bar5_from_arm>:
- 1038: e59fc000 ldr ip, \[pc, #0\] ; 1040 <__bar5_from_arm\+0x8>
+00001038 <__bar_from_arm>:
+ 1038: e59fc000 ldr ip, \[pc, #0\] ; 1040 <__bar_from_arm\+0x8>
103c: e12fff1c bx ip
- 1040: 0200302f .word 0x0200302f
+ 1040: 02003021 .word 0x02003021
-00001044 <__bar3_veneer>:
- 1044: e51ff004 ldr pc, \[pc, #-4\] ; 1048 <__bar3_veneer\+0x4>
- 1048: 02003028 .word 0x02003028
+00001044 <__bar2_veneer>:
+ 1044: e51ff004 ldr pc, \[pc, #-4\] ; 1048 <__bar2_veneer\+0x4>
+ 1048: 02003024 .word 0x02003024
...
Disassembly of section .foo:
diff --git a/ld/testsuite/ld-arm/farcall-mixed-lib-v4t.d b/ld/testsuite/ld-arm/farcall-mixed-lib-v4t.d
index b6729b200b..0863e9d40a 100644
--- a/ld/testsuite/ld-arm/farcall-mixed-lib-v4t.d
+++ b/ld/testsuite/ld-arm/farcall-mixed-lib-v4t.d
@@ -89,26 +89,26 @@ Disassembly of section .text:
...
.* <__real_lib_func3>:
- .*: f000 f806 bl 2000380 <__app_func_from_thumb>
- .*: f000 f80c bl 2000390 <__app_func_weak_from_thumb>
+ .*: f000 f80e bl 2000390 <__app_func_from_thumb>
+ .*: f000 f804 bl 2000380 <__app_func_weak_from_thumb>
.*: 4770 bx lr
.*: 46c0 nop ; \(mov r8, r8\)
.*: 46c0 nop ; \(mov r8, r8\)
.*: 46c0 nop ; \(mov r8, r8\)
-.* <__app_func_from_thumb>:
+.* <__app_func_weak_from_thumb>:
.*: 4778 bx pc
.*: 46c0 nop ; \(mov r8, r8\)
- .*: e59fc000 ldr ip, \[pc, #0\] ; 200038c <__app_func_from_thumb\+0xc>
+ .*: e59fc000 ldr ip, \[pc, #0\] ; 200038c <__app_func_weak_from_thumb\+0xc>
.*: e08cf00f add pc, ip, pc
- .*: fdffff18 .word 0xfdffff18
+ .*: fdffff28 .word 0xfdffff28
-.* <__app_func_weak_from_thumb>:
+.* <__app_func_from_thumb>:
.*: 4778 bx pc
.*: 46c0 nop ; \(mov r8, r8\)
- .*: e59fc000 ldr ip, \[pc, #0\] ; 200039c <__app_func_weak_from_thumb\+0xc>
+ .*: e59fc000 ldr ip, \[pc, #0\] ; 200039c <__app_func_from_thumb\+0xc>
.*: e08cf00f add pc, ip, pc
- .*: fdffff18 .word 0xfdffff18
+ .*: fdffff08 .word 0xfdffff08
.* <lib_func3>:
.*: e59fc004 ldr ip, \[pc, #4\] ; 20003ac <lib_func3\+0xc>
diff --git a/ld/testsuite/ld-arm/farcall-mixed-lib.d b/ld/testsuite/ld-arm/farcall-mixed-lib.d
index 9df3933bc2..2b0b9acda1 100644
--- a/ld/testsuite/ld-arm/farcall-mixed-lib.d
+++ b/ld/testsuite/ld-arm/farcall-mixed-lib.d
@@ -73,20 +73,20 @@ Disassembly of section .text:
...
.* <lib_func3>:
- .*: f000 e806 blx 2000370 <__app_func_from_thumb>
- .*: f000 e80a blx 200037c <__app_func_weak_from_thumb>
+ .*: f000 e80c blx 200037c <__app_func_from_thumb>
+ .*: f000 e804 blx 2000370 <__app_func_weak_from_thumb>
.*: 4770 bx lr
.*: 46c0 nop ; \(mov r8, r8\)
.*: 46c0 nop ; \(mov r8, r8\)
.*: 46c0 nop ; \(mov r8, r8\)
-.* <__app_func_from_thumb>:
- .*: e59fc000 ldr ip, \[pc, #0\] ; 2000378 <__app_func_from_thumb\+0x8>
+.* <__app_func_weak_from_thumb>:
+ .*: e59fc000 ldr ip, \[pc, #0\] ; 2000378 <__app_func_weak_from_thumb\+0x8>
.*: e08ff00c add pc, pc, ip
- .*: fdffff28 .word 0xfdffff28
+ .*: fdffff34 .word 0xfdffff34
-.* <__app_func_weak_from_thumb>:
- .*: e59fc000 ldr ip, \[pc, #0\] ; 2000384 <__app_func_weak_from_thumb\+0x8>
+.* <__app_func_from_thumb>:
+ .*: e59fc000 ldr ip, \[pc, #0\] ; 2000384 <__app_func_from_thumb\+0x8>
.*: e08ff00c add pc, pc, ip
- .*: fdffff28 .word 0xfdffff28
+ .*: fdffff1c .word 0xfdffff1c
...
diff --git a/ld/testsuite/ld-arm/ifunc-1.dd b/ld/testsuite/ld-arm/ifunc-1.dd
new file mode 100644
index 0000000000..de6d813ade
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-1.dd
@@ -0,0 +1,139 @@
+
+.*
+
+
+Disassembly of section \.iplt:
+
+00009000 <f3-0xc>:
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ 9000: e28fc600 add ip, pc, #0
+ 9004: e28cca08 add ip, ip, #32768 ; 0x8000
+ 9008: e5bcf004 ldr pc, \[ip, #4\]!
+
+0000900c <f3>:
+ 900c: e28fc600 add ip, pc, #0
+ 9010: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9014: e5bcfffc ldr pc, \[ip, #4092\]! ; 0xffc
+
+00009018 <f2>:
+ 9018: e28fc600 add ip, pc, #0
+ 901c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9020: e5bcfff4 ldr pc, \[ip, #4084\]! ; 0xff4
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+ a004: e1a0f00e mov pc, lr
+ a008: e1a0f00e mov pc, lr
+
+0000a00c <_start>:
+ a00c: eb0017fb bl 10000 <foo>
+ a010: e59f400c ldr r4, \[pc, #12\] ; a024 <_start\+0x18>
+ a014: e59f400c ldr r4, \[pc, #12\] ; a028 <_start\+0x1c>
+ a018: e59f400c ldr r4, \[pc, #12\] ; a02c <_start\+0x20>
+ a01c: e59f400c ldr r4, \[pc, #12\] ; a030 <_start\+0x24>
+ a020: e59f500c ldr r5, \[pc, #12\] ; a034 <_start\+0x28>
+#------------------------------------------------------------------------------
+#------ foo
+#------------------------------------------------------------------------------
+ a024: 00010000 \.word 0x00010000
+#------------------------------------------------------------------------------
+#------ PC-relative offset of foo
+#------------------------------------------------------------------------------
+ a028: 00005fd8 \.word 0x00005fd8
+#------------------------------------------------------------------------------
+#------ GP-relative offset of foo
+#------------------------------------------------------------------------------
+ a02c: fffff000 \.word 0xfffff000
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a030: 00000020 \.word 0x00000020
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a034: 00006fe4 \.word 0x00006fe4
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a038: ebfffbf0 bl 9000 <__irel_end\+0xfe8>
+ a03c: e59f400c ldr r4, \[pc, #12\] ; a050 <_start\+0x44>
+ a040: e59f400c ldr r4, \[pc, #12\] ; a054 <_start\+0x48>
+ a044: e59f400c ldr r4, \[pc, #12\] ; a058 <_start\+0x4c>
+ a048: e59f400c ldr r4, \[pc, #12\] ; a05c <_start\+0x50>
+ a04c: e59f500c ldr r5, \[pc, #12\] ; a060 <_start\+0x54>
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a050: 00009000 \.word 0x00009000
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f1's .iplt entry
+#------------------------------------------------------------------------------
+ a054: ffffefac \.word 0xffffefac
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f1's .iplt entry
+#------------------------------------------------------------------------------
+ a058: ffff8000 \.word 0xffff8000
+#------------------------------------------------------------------------------
+#------ .got offset for f1's .iplt entry
+#------------------------------------------------------------------------------
+ a05c: 0000001c \.word 0x0000001c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f1's .iplt entry
+#------------------------------------------------------------------------------
+ a060: 00006fbc \.word 0x00006fbc
+ a064: ebfffbeb bl 9018 <f2>
+ a068: e59f400c ldr r4, \[pc, #12\] ; a07c <_start\+0x70>
+ a06c: e59f400c ldr r4, \[pc, #12\] ; a080 <_start\+0x74>
+ a070: e59f400c ldr r4, \[pc, #12\] ; a084 <_start\+0x78>
+ a074: e59f400c ldr r4, \[pc, #12\] ; a088 <_start\+0x7c>
+ a078: e59f500c ldr r5, \[pc, #12\] ; a08c <_start\+0x80>
+#------------------------------------------------------------------------------
+#------ f2
+#------------------------------------------------------------------------------
+ a07c: 00009018 \.word 0x00009018
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f2
+#------------------------------------------------------------------------------
+ a080: ffffef98 \.word 0xffffef98
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f2
+#------------------------------------------------------------------------------
+ a084: ffff8018 \.word 0xffff8018
+#------------------------------------------------------------------------------
+#------ .got offset for f2
+#------------------------------------------------------------------------------
+ a088: 00000028 \.word 0x00000028
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f2
+#------------------------------------------------------------------------------
+ a08c: 00006f9c \.word 0x00006f9c
+ a090: ebfffbdd bl 900c <f3>
+ a094: e59f400c ldr r4, \[pc, #12\] ; a0a8 <_start\+0x9c>
+ a098: e59f400c ldr r4, \[pc, #12\] ; a0ac <_start\+0xa0>
+ a09c: e59f400c ldr r4, \[pc, #12\] ; a0b0 <_start\+0xa4>
+ a0a0: e59f400c ldr r4, \[pc, #12\] ; a0b4 <_start\+0xa8>
+ a0a4: e59f500c ldr r5, \[pc, #12\] ; a0b8 <_start\+0xac>
+#------------------------------------------------------------------------------
+#------ f3
+#------------------------------------------------------------------------------
+ a0a8: 0000900c \.word 0x0000900c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f3
+#------------------------------------------------------------------------------
+ a0ac: ffffef60 \.word 0xffffef60
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f3
+#------------------------------------------------------------------------------
+ a0b0: ffff800c \.word 0xffff800c
+#------------------------------------------------------------------------------
+#------ .got offset for f3
+#------------------------------------------------------------------------------
+ a0b4: 00000024 \.word 0x00000024
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f3
+#------------------------------------------------------------------------------
+ a0b8: 00006f6c \.word 0x00006f6c
diff --git a/ld/testsuite/ld-arm/ifunc-1.gd b/ld/testsuite/ld-arm/ifunc-1.gd
new file mode 100644
index 0000000000..ff51d37ed1
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-1.gd
@@ -0,0 +1,29 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------------------------------------------------------------------------------
+ 10000 44332211 00800000 18800000 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: f1's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11000 00000000 00000000 00000000 00a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: f3's .igot.plt pointer to 0xa008 [R_ARM_IRELATIVE]
+#------ 00011014: f2's .igot.plt pointer to 0xa004 [R_ARM_IRELATIVE]
+#------ 00011018: .got entry for foo
+#------ 0001101c: .got entry for f1's .iplt entry
+#------------------------------------------------------------------------------
+ 11010 08a00000 04a00000 00000100 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011020: .got entry for foo
+#------ 00011024: .got entry for f3
+#------ 00011028: .got entry for f2
+#------------------------------------------------------------------------------
+ 11020 00000100 0c900000 18900000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-1.rd b/ld/testsuite/ld-arm/ifunc-1.rd
new file mode 100644
index 0000000000..75e6d700bc
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-1.rd
@@ -0,0 +1,8 @@
+
+There is no dynamic section in this file\.
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 3 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......a0 R_ARM_IRELATIVE
+00011010 ......a0 R_ARM_IRELATIVE
+00011014 ......a0 R_ARM_IRELATIVE
diff --git a/ld/testsuite/ld-arm/ifunc-1.s b/ld/testsuite/ld-arm/ifunc-1.s
new file mode 100644
index 0000000000..7745c548f0
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-1.s
@@ -0,0 +1,48 @@
+ .macro define,name
+ .type \name,%gnu_indirect_function
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name
+ bl \name
+ ldr r4,1f
+ ldr r4,2f
+ ldr r4,3f
+ ldr r4,4f
+ ldr r5,5f
+1:
+ .word \name
+2:
+ .word \name-.
+3:
+ .word \name(GOTOFF)
+4:
+ .word \name(GOT)
+5:
+ .word \name(GOT_PREL)
+ .endm
+
+ .global f2
+
+ .global f3
+ .hidden f3
+
+ define f1
+ define f2
+ define f3
+
+ .globl _start
+_start:
+ test_relocs foo
+ test_relocs f1
+ test_relocs f2
+ test_relocs f3
+ .size _start,.-_start
+
+ .data
+foo:
+ .word 0x11223344
+ .word __irel_start
+ .word __irel_end
diff --git a/ld/testsuite/ld-arm/ifunc-10.dd b/ld/testsuite/ld-arm/ifunc-10.dd
new file mode 100644
index 0000000000..5f876fb374
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-10.dd
@@ -0,0 +1,951 @@
+
+.*
+
+
+Disassembly of section \.plt:
+
+00009000 <\.plt>:
+ 9000: e52de004 push {lr} ; \(str lr, \[sp, #-4\]!\)
+ 9004: e59fe004 ldr lr, \[pc, #4\] ; 9010 <atf3-0x110>
+ 9008: e08fe00e add lr, pc, lr
+ 900c: e5bef008 ldr pc, \[lr, #8\]!
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got.plt
+#------------------------------------------------------------------------------
+ 9010: 00007ff0 \.word 0x00007ff0
+#------------------------------------------------------------------------------
+#------ thumb entry to atf2's .plt entry
+#------------------------------------------------------------------------------
+ 9014: 4778 bx pc
+ 9016: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ atf2's .plt entry
+#------------------------------------------------------------------------------
+ 9018: e28fc600 add ip, pc, #0
+ 901c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9020: e5bcffec ldr pc, \[ip, #4076\]! ; 0xfec
+#------------------------------------------------------------------------------
+#------ aaf4's .plt entry
+#------------------------------------------------------------------------------
+ 9024: e28fc600 add ip, pc, #0
+ 9028: e28cca07 add ip, ip, #28672 ; 0x7000
+ 902c: e5bcffe4 ldr pc, \[ip, #4068\]! ; 0xfe4
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf2's .plt entry
+#------------------------------------------------------------------------------
+ 9030: 4778 bx pc
+ 9032: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ ttf2's .plt entry
+#------------------------------------------------------------------------------
+ 9034: e28fc600 add ip, pc, #0
+ 9038: e28cca07 add ip, ip, #28672 ; 0x7000
+ 903c: e5bcffd8 ldr pc, \[ip, #4056\]! ; 0xfd8
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf2's .plt entry
+#------------------------------------------------------------------------------
+ 9040: 4778 bx pc
+ 9042: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ 9044: e28fc600 add ip, pc, #0
+ 9048: e28cca07 add ip, ip, #28672 ; 0x7000
+ 904c: e5bcffcc ldr pc, \[ip, #4044\]! ; 0xfcc
+#------------------------------------------------------------------------------
+#------ taf2's .plt entry
+#------------------------------------------------------------------------------
+ 9050: e28fc600 add ip, pc, #0
+ 9054: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9058: e5bcffc4 ldr pc, \[ip, #4036\]! ; 0xfc4
+#------------------------------------------------------------------------------
+#------ aaf2's .plt entry
+#------------------------------------------------------------------------------
+ 905c: e28fc600 add ip, pc, #0
+ 9060: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9064: e5bcffbc ldr pc, \[ip, #4028\]! ; 0xfbc
+#------------------------------------------------------------------------------
+#------ thumb entry to abf4's .plt entry
+#------------------------------------------------------------------------------
+ 9068: 4778 bx pc
+ 906a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ abf4's .plt entry
+#------------------------------------------------------------------------------
+ 906c: e28fc600 add ip, pc, #0
+ 9070: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9074: e5bcffb0 ldr pc, \[ip, #4016\]! ; 0xfb0
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf4's .plt entry
+#------------------------------------------------------------------------------
+ 9078: 4778 bx pc
+ 907a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ tbf4's .plt entry
+#------------------------------------------------------------------------------
+ 907c: e28fc600 add ip, pc, #0
+ 9080: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9084: e5bcffa4 ldr pc, \[ip, #4004\]! ; 0xfa4
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf4's .plt entry
+#------------------------------------------------------------------------------
+ 9088: 4778 bx pc
+ 908a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ ttf4's .plt entry
+#------------------------------------------------------------------------------
+ 908c: e28fc600 add ip, pc, #0
+ 9090: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9094: e5bcff98 ldr pc, \[ip, #3992\]! ; 0xf98
+#------------------------------------------------------------------------------
+#------ thumb entry to atf4's .plt entry
+#------------------------------------------------------------------------------
+ 9098: 4778 bx pc
+ 909a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ atf4's .plt entry
+#------------------------------------------------------------------------------
+ 909c: e28fc600 add ip, pc, #0
+ 90a0: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90a4: e5bcff8c ldr pc, \[ip, #3980\]! ; 0xf8c
+#------------------------------------------------------------------------------
+#------ taf4's .plt entry
+#------------------------------------------------------------------------------
+ 90a8: e28fc600 add ip, pc, #0
+ 90ac: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90b0: e5bcff84 ldr pc, \[ip, #3972\]! ; 0xf84
+#------------------------------------------------------------------------------
+#------ thumb entry to abf2's .plt entry
+#------------------------------------------------------------------------------
+ 90b4: 4778 bx pc
+ 90b6: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ 90b8: e28fc600 add ip, pc, #0
+ 90bc: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90c0: e5bcff78 ldr pc, \[ip, #3960\]! ; 0xf78
+
+Disassembly of section \.iplt:
+
+000090c4 <atf3-0x5c>:
+#------------------------------------------------------------------------------
+#------ aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90c4: e28fc600 add ip, pc, #0
+ 90c8: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90cc: e5bcff70 ldr pc, \[ip, #3952\]! ; 0xf70
+#------------------------------------------------------------------------------
+#------ thumb entry to atf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90d0: 4778 bx pc
+ 90d2: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ atf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90d4: e28fc600 add ip, pc, #0
+ 90d8: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90dc: e5bcff64 ldr pc, \[ip, #3940\]! ; 0xf64
+#------------------------------------------------------------------------------
+#------ thumb entry to abf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90e0: 4778 bx pc
+ 90e2: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90e4: e28fc600 add ip, pc, #0
+ 90e8: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90ec: e5bcff58 ldr pc, \[ip, #3928\]! ; 0xf58
+#------------------------------------------------------------------------------
+#------ taf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90f0: e28fc600 add ip, pc, #0
+ 90f4: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90f8: e5bcff50 ldr pc, \[ip, #3920\]! ; 0xf50
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90fc: 4778 bx pc
+ 90fe: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ 9100: e28fc600 add ip, pc, #0
+ 9104: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9108: e5bcff44 ldr pc, \[ip, #3908\]! ; 0xf44
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ 910c: 4778 bx pc
+ 910e: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ 9110: e28fc600 add ip, pc, #0
+ 9114: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9118: e5bcff38 ldr pc, \[ip, #3896\]! ; 0xf38
+#------------------------------------------------------------------------------
+#------ thumb entry to atf3
+#------------------------------------------------------------------------------
+ 911c: 4778 bx pc
+ 911e: 46c0 nop ; \(mov r8, r8\)
+
+00009120 <atf3>:
+ 9120: e28fc600 add ip, pc, #0
+ 9124: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9128: e5bcff2c ldr pc, \[ip, #3884\]! ; 0xf2c
+#------------------------------------------------------------------------------
+#------ thumb entry to abf3
+#------------------------------------------------------------------------------
+ 912c: 4778 bx pc
+ 912e: 46c0 nop ; \(mov r8, r8\)
+
+00009130 <abf3>:
+ 9130: e28fc600 add ip, pc, #0
+ 9134: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9138: e5bcff20 ldr pc, \[ip, #3872\]! ; 0xf20
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf3
+#------------------------------------------------------------------------------
+ 913c: 4778 bx pc
+ 913e: 46c0 nop ; \(mov r8, r8\)
+
+00009140 <ttf3>:
+ 9140: e28fc600 add ip, pc, #0
+ 9144: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9148: e5bcff14 ldr pc, \[ip, #3860\]! ; 0xf14
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf3
+#------------------------------------------------------------------------------
+ 914c: 4778 bx pc
+ 914e: 46c0 nop ; \(mov r8, r8\)
+
+00009150 <tbf3>:
+ 9150: e28fc600 add ip, pc, #0
+ 9154: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9158: e5bcff08 ldr pc, \[ip, #3848\]! ; 0xf08
+
+0000915c <taf3>:
+ 915c: e28fc600 add ip, pc, #0
+ 9160: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9164: e5bcff00 ldr pc, \[ip, #3840\]! ; 0xf00
+
+00009168 <aaf3>:
+ 9168: e28fc600 add ip, pc, #0
+ 916c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9170: e5bcfef8 ldr pc, \[ip, #3832\]! ; 0xef8
+
+Disassembly of section \.text:
+
+0000a000 <aaf1>:
+ a000: e1a0f00e mov pc, lr
+
+0000a004 <atf1>:
+ a004: e1a0f00e mov pc, lr
+
+0000a008 <abf1>:
+ a008: e1a0f00e mov pc, lr
+
+0000a00c <taf1>:
+ a00c: 46f7 mov pc, lr
+
+0000a00e <ttf1>:
+ a00e: 46f7 mov pc, lr
+
+0000a010 <tbf1>:
+ a010: 46f7 mov pc, lr
+ a012: 0000 movs r0, r0
+ a014: e1a0f00e mov pc, lr
+ a018: e1a0f00e mov pc, lr
+ a01c: e1a0f00e mov pc, lr
+ a020: 46f7 mov pc, lr
+ a022: 46f7 mov pc, lr
+ a024: 46f7 mov pc, lr
+ \.\.\.
+
+0000a028 <_start>:
+ a028: eb0017f4 bl 10000 <foo>
+ a02c: ea0017f3 b 10000 <foo>
+ a030: 0a0017f2 beq 10000 <foo>
+ a034: e59f4000 ldr r4, \[pc, #0\] ; a03c <_start\+0x14>
+ a038: e59f4000 ldr r4, \[pc, #0\] ; a040 <_start\+0x18>
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a03c: 00000088 \.word 0x00000088
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a040: 0000702c \.word 0x0000702c
+#------------------------------------------------------------------------------
+#------ aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ a044: ebfffc1e bl 90c4 <atf3-0x5c>
+#------------------------------------------------------------------------------
+#------ aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ a048: eafffc1d b 90c4 <atf3-0x5c>
+#------------------------------------------------------------------------------
+#------ aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ a04c: 0afffc1c beq 90c4 <atf3-0x5c>
+ a050: e59f4000 ldr r4, \[pc, #0\] ; a058 <_start\+0x30>
+ a054: e59f4000 ldr r4, \[pc, #0\] ; a05c <_start\+0x34>
+#------------------------------------------------------------------------------
+#------ .got offset for aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ a058: 00000070 \.word 0x00000070
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ a05c: 00007014 \.word 0x00007014
+#------------------------------------------------------------------------------
+#------ taf1's .iplt entry
+#------------------------------------------------------------------------------
+ a060: ebfffc22 bl 90f0 <atf3-0x30>
+#------------------------------------------------------------------------------
+#------ taf1's .iplt entry
+#------------------------------------------------------------------------------
+ a064: eafffc21 b 90f0 <atf3-0x30>
+#------------------------------------------------------------------------------
+#------ taf1's .iplt entry
+#------------------------------------------------------------------------------
+ a068: 0afffc20 beq 90f0 <atf3-0x30>
+ a06c: e59f4000 ldr r4, \[pc, #0\] ; a074 <_start\+0x4c>
+ a070: e59f4000 ldr r4, \[pc, #0\] ; a078 <_start\+0x50>
+#------------------------------------------------------------------------------
+#------ .got offset for taf1's .iplt entry
+#------------------------------------------------------------------------------
+ a074: 0000007c \.word 0x0000007c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for taf1's .iplt entry
+#------------------------------------------------------------------------------
+ a078: 00007004 \.word 0x00007004
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a07c: ebfffc18 bl 90e4 <atf3-0x3c>
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a080: eafffc17 b 90e4 <atf3-0x3c>
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a084: 0afffc16 beq 90e4 <atf3-0x3c>
+ a088: e59f4000 ldr r4, \[pc, #0\] ; a090 <_start\+0x68>
+ a08c: e59f4000 ldr r4, \[pc, #0\] ; a094 <_start\+0x6c>
+#------------------------------------------------------------------------------
+#------ .got offset for abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a090: 00000078 \.word 0x00000078
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a094: 00006fe4 \.word 0x00006fe4
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a098: ebfffc1c bl 9110 <atf3-0x10>
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a09c: eafffc1b b 9110 <atf3-0x10>
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a0a0: 0afffc1a beq 9110 <atf3-0x10>
+ a0a4: e59f4000 ldr r4, \[pc, #0\] ; a0ac <_start\+0x84>
+ a0a8: e59f4000 ldr r4, \[pc, #0\] ; a0b0 <_start\+0x88>
+#------------------------------------------------------------------------------
+#------ .got offset for tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a0ac: 00000084 \.word 0x00000084
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a0b0: 00006fd4 \.word 0x00006fd4
+#------------------------------------------------------------------------------
+#------ aaf2's .plt entry
+#------------------------------------------------------------------------------
+ a0b4: ebfffbe8 bl 905c <atf3-0xc4>
+#------------------------------------------------------------------------------
+#------ aaf2's .plt entry
+#------------------------------------------------------------------------------
+ a0b8: eafffbe7 b 905c <atf3-0xc4>
+#------------------------------------------------------------------------------
+#------ aaf2's .plt entry
+#------------------------------------------------------------------------------
+ a0bc: 0afffbe6 beq 905c <atf3-0xc4>
+ a0c0: e59f4000 ldr r4, \[pc, #0\] ; a0c8 <_start\+0xa0>
+ a0c4: e59f4000 ldr r4, \[pc, #0\] ; a0cc <_start\+0xa4>
+#------------------------------------------------------------------------------
+#------ .got offset for aaf2
+#------------------------------------------------------------------------------
+ a0c8: 000000a8 \.word 0x000000a8
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for aaf2
+#------------------------------------------------------------------------------
+ a0cc: 00006fdc \.word 0x00006fdc
+#------------------------------------------------------------------------------
+#------ taf2's .plt entry
+#------------------------------------------------------------------------------
+ a0d0: ebfffbde bl 9050 <atf3-0xd0>
+#------------------------------------------------------------------------------
+#------ taf2's .plt entry
+#------------------------------------------------------------------------------
+ a0d4: eafffbdd b 9050 <atf3-0xd0>
+#------------------------------------------------------------------------------
+#------ taf2's .plt entry
+#------------------------------------------------------------------------------
+ a0d8: 0afffbdc beq 9050 <atf3-0xd0>
+ a0dc: e59f4000 ldr r4, \[pc, #0\] ; a0e4 <_start\+0xbc>
+ a0e0: e59f4000 ldr r4, \[pc, #0\] ; a0e8 <_start\+0xc0>
+#------------------------------------------------------------------------------
+#------ .got offset for taf2
+#------------------------------------------------------------------------------
+ a0e4: 000000a4 \.word 0x000000a4
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for taf2
+#------------------------------------------------------------------------------
+ a0e8: 00006fbc \.word 0x00006fbc
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ a0ec: ebfffbf1 bl 90b8 <atf3-0x68>
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ a0f0: eafffbf0 b 90b8 <atf3-0x68>
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ a0f4: 0afffbef beq 90b8 <atf3-0x68>
+ a0f8: e59f4000 ldr r4, \[pc, #0\] ; a100 <_start\+0xd8>
+ a0fc: e59f4000 ldr r4, \[pc, #0\] ; a104 <_start\+0xdc>
+#------------------------------------------------------------------------------
+#------ .got offset for abf2
+#------------------------------------------------------------------------------
+ a100: 000000d0 \.word 0x000000d0
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf2
+#------------------------------------------------------------------------------
+ a104: 00006fcc \.word 0x00006fcc
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a108: ebfffbcd bl 9044 <atf3-0xdc>
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a10c: eafffbcc b 9044 <atf3-0xdc>
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a110: 0afffbcb beq 9044 <atf3-0xdc>
+ a114: e59f4000 ldr r4, \[pc, #0\] ; a11c <_start\+0xf4>
+ a118: e59f4000 ldr r4, \[pc, #0\] ; a120 <_start\+0xf8>
+#------------------------------------------------------------------------------
+#------ .got offset for tbf2
+#------------------------------------------------------------------------------
+ a11c: 00000098 \.word 0x00000098
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf2
+#------------------------------------------------------------------------------
+ a120: 00006f78 \.word 0x00006f78
+ a124: ebfffc0f bl 9168 <aaf3>
+ a128: eafffc0e b 9168 <aaf3>
+ a12c: 0afffc0d beq 9168 <aaf3>
+ a130: e59f4000 ldr r4, \[pc, #0\] ; a138 <_start\+0x110>
+ a134: e59f4000 ldr r4, \[pc, #0\] ; a13c <_start\+0x114>
+#------------------------------------------------------------------------------
+#------ .got offset for aaf3
+#------------------------------------------------------------------------------
+ a138: 000000c4 \.word 0x000000c4
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for aaf3
+#------------------------------------------------------------------------------
+ a13c: 00006f88 \.word 0x00006f88
+ a140: ebfffc05 bl 915c <taf3>
+ a144: eafffc04 b 915c <taf3>
+ a148: 0afffc03 beq 915c <taf3>
+ a14c: e59f4000 ldr r4, \[pc, #0\] ; a154 <_start\+0x12c>
+ a150: e59f4000 ldr r4, \[pc, #0\] ; a158 <_start\+0x130>
+#------------------------------------------------------------------------------
+#------ .got offset for taf3
+#------------------------------------------------------------------------------
+ a154: 000000b4 \.word 0x000000b4
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for taf3
+#------------------------------------------------------------------------------
+ a158: 00006f5c \.word 0x00006f5c
+ a15c: ebfffbf3 bl 9130 <abf3>
+ a160: eafffbf2 b 9130 <abf3>
+ a164: 0afffbf1 beq 9130 <abf3>
+ a168: e59f4000 ldr r4, \[pc, #0\] ; a170 <_start\+0x148>
+ a16c: e59f4000 ldr r4, \[pc, #0\] ; a174 <_start\+0x14c>
+#------------------------------------------------------------------------------
+#------ .got offset for abf3
+#------------------------------------------------------------------------------
+ a170: 000000a0 \.word 0x000000a0
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf3
+#------------------------------------------------------------------------------
+ a174: 00006f2c \.word 0x00006f2c
+ a178: ebfffbf4 bl 9150 <tbf3>
+ a17c: eafffbf3 b 9150 <tbf3>
+ a180: 0afffbf2 beq 9150 <tbf3>
+ a184: e59f4000 ldr r4, \[pc, #0\] ; a18c <_start\+0x164>
+ a188: e59f4000 ldr r4, \[pc, #0\] ; a190 <_start\+0x168>
+#------------------------------------------------------------------------------
+#------ .got offset for tbf3
+#------------------------------------------------------------------------------
+ a18c: 000000b0 \.word 0x000000b0
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf3
+#------------------------------------------------------------------------------
+ a190: 00006f20 \.word 0x00006f20
+#------------------------------------------------------------------------------
+#------ aaf4's .plt entry
+#------------------------------------------------------------------------------
+ a194: ebfffba2 bl 9024 <atf3-0xfc>
+#------------------------------------------------------------------------------
+#------ aaf4's .plt entry
+#------------------------------------------------------------------------------
+ a198: eafffba1 b 9024 <atf3-0xfc>
+#------------------------------------------------------------------------------
+#------ aaf4's .plt entry
+#------------------------------------------------------------------------------
+ a19c: 0afffba0 beq 9024 <atf3-0xfc>
+ a1a0: e59f4000 ldr r4, \[pc, #0\] ; a1a8 <_start\+0x180>
+ a1a4: e59f4000 ldr r4, \[pc, #0\] ; a1ac <_start\+0x184>
+#------------------------------------------------------------------------------
+#------ .got offset for aaf4
+#------------------------------------------------------------------------------
+ a1a8: 00000090 \.word 0x00000090
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for aaf4
+#------------------------------------------------------------------------------
+ a1ac: 00006ee4 \.word 0x00006ee4
+#------------------------------------------------------------------------------
+#------ taf4's .plt entry
+#------------------------------------------------------------------------------
+ a1b0: ebfffbbc bl 90a8 <atf3-0x78>
+#------------------------------------------------------------------------------
+#------ taf4's .plt entry
+#------------------------------------------------------------------------------
+ a1b4: eafffbbb b 90a8 <atf3-0x78>
+#------------------------------------------------------------------------------
+#------ taf4's .plt entry
+#------------------------------------------------------------------------------
+ a1b8: 0afffbba beq 90a8 <atf3-0x78>
+ a1bc: e59f4000 ldr r4, \[pc, #0\] ; a1c4 <_start\+0x19c>
+ a1c0: e59f4000 ldr r4, \[pc, #0\] ; a1c8 <_start\+0x1a0>
+#------------------------------------------------------------------------------
+#------ .got offset for taf4
+#------------------------------------------------------------------------------
+ a1c4: 000000cc \.word 0x000000cc
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for taf4
+#------------------------------------------------------------------------------
+ a1c8: 00006f04 \.word 0x00006f04
+#------------------------------------------------------------------------------
+#------ abf4's .plt entry
+#------------------------------------------------------------------------------
+ a1cc: ebfffba6 bl 906c <atf3-0xb4>
+#------------------------------------------------------------------------------
+#------ abf4's .plt entry
+#------------------------------------------------------------------------------
+ a1d0: eafffba5 b 906c <atf3-0xb4>
+#------------------------------------------------------------------------------
+#------ abf4's .plt entry
+#------------------------------------------------------------------------------
+ a1d4: 0afffba4 beq 906c <atf3-0xb4>
+ a1d8: e59f4000 ldr r4, \[pc, #0\] ; a1e0 <_start\+0x1b8>
+ a1dc: e59f4000 ldr r4, \[pc, #0\] ; a1e4 <_start\+0x1bc>
+#------------------------------------------------------------------------------
+#------ .got offset for abf4
+#------------------------------------------------------------------------------
+ a1e0: 000000b8 \.word 0x000000b8
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf4
+#------------------------------------------------------------------------------
+ a1e4: 00006ed4 \.word 0x00006ed4
+#------------------------------------------------------------------------------
+#------ tbf4's .plt entry
+#------------------------------------------------------------------------------
+ a1e8: ebfffba3 bl 907c <atf3-0xa4>
+#------------------------------------------------------------------------------
+#------ tbf4's .plt entry
+#------------------------------------------------------------------------------
+ a1ec: eafffba2 b 907c <atf3-0xa4>
+#------------------------------------------------------------------------------
+#------ tbf4's .plt entry
+#------------------------------------------------------------------------------
+ a1f0: 0afffba1 beq 907c <atf3-0xa4>
+ a1f4: e59f4000 ldr r4, \[pc, #0\] ; a1fc <_start\+0x1d4>
+ a1f8: e59f4000 ldr r4, \[pc, #0\] ; a200 <_start\+0x1d8>
+#------------------------------------------------------------------------------
+#------ .got offset for tbf4
+#------------------------------------------------------------------------------
+ a1fc: 000000bc \.word 0x000000bc
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf4
+#------------------------------------------------------------------------------
+ a200: 00006ebc \.word 0x00006ebc
+
+0000a204 <_thumb>:
+ a204: f005 fefc bl 10000 <foo>
+ a208: f005 befa b\.w 10000 <foo>
+ a20c: f005 86f8 beq\.w 10000 <foo>
+ a210: 4c00 ldr r4, \[pc, #0\] ; \(a214 <_thumb\+0x10>\)
+ a212: 4c01 ldr r4, \[pc, #4\] ; \(a218 <_thumb\+0x14>\)
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a214: 00000088 \.word 0x00000088
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a218: 00006e54 \.word 0x00006e54
+#------------------------------------------------------------------------------
+#------ atf1's .iplt entry
+#------------------------------------------------------------------------------
+ a21c: f7fe ef5a blx 90d4 <atf3-0x4c>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf1's .iplt entry
+#------------------------------------------------------------------------------
+ a220: f7fe bf56 b\.w 90d0 <atf3-0x50>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf1's .iplt entry
+#------------------------------------------------------------------------------
+ a224: f43e af54 beq\.w 90d0 <atf3-0x50>
+ a228: 4c00 ldr r4, \[pc, #0\] ; \(a22c <_thumb\+0x28>\)
+ a22a: 4c01 ldr r4, \[pc, #4\] ; \(a230 <_thumb\+0x2c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for atf1's .iplt entry
+#------------------------------------------------------------------------------
+ a22c: 00000074 \.word 0x00000074
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for atf1's .iplt entry
+#------------------------------------------------------------------------------
+ a230: 00006e44 \.word 0x00006e44
+#------------------------------------------------------------------------------
+#------ ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ a234: f7fe ef64 blx 9100 <atf3-0x20>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ a238: f7fe bf60 b\.w 90fc <atf3-0x24>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ a23c: f43e af5e beq\.w 90fc <atf3-0x24>
+ a240: 4c00 ldr r4, \[pc, #0\] ; \(a244 <_thumb\+0x40>\)
+ a242: 4c01 ldr r4, \[pc, #4\] ; \(a248 <_thumb\+0x44>\)
+#------------------------------------------------------------------------------
+#------ .got offset for ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ a244: 00000080 \.word 0x00000080
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ a248: 00006e38 \.word 0x00006e38
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a24c: f7fe ef4a blx 90e4 <atf3-0x3c>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a250: f7fe bf46 b\.w 90e0 <atf3-0x40>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a254: f43e af44 beq\.w 90e0 <atf3-0x40>
+ a258: 4c00 ldr r4, \[pc, #0\] ; \(a25c <_thumb\+0x58>\)
+ a25a: 4c01 ldr r4, \[pc, #4\] ; \(a260 <_thumb\+0x5c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a25c: 00000078 \.word 0x00000078
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a260: 00006e18 \.word 0x00006e18
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a264: f7fe ef54 blx 9110 <atf3-0x10>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a268: f7fe bf50 b\.w 910c <atf3-0x14>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a26c: f43e af4e beq\.w 910c <atf3-0x14>
+ a270: 4c00 ldr r4, \[pc, #0\] ; \(a274 <_thumb\+0x70>\)
+ a272: 4c01 ldr r4, \[pc, #4\] ; \(a278 <_thumb\+0x74>\)
+#------------------------------------------------------------------------------
+#------ .got offset for tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a274: 00000084 \.word 0x00000084
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a278: 00006e0c \.word 0x00006e0c
+#------------------------------------------------------------------------------
+#------ atf2's .plt entry
+#------------------------------------------------------------------------------
+ a27c: f7fe eecc blx 9018 <atf3-0x108>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf2's .plt entry
+#------------------------------------------------------------------------------
+ a280: f7fe bec8 b\.w 9014 <atf3-0x10c>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf2's .plt entry
+#------------------------------------------------------------------------------
+ a284: f43e aec6 beq\.w 9014 <atf3-0x10c>
+ a288: 4c00 ldr r4, \[pc, #0\] ; \(a28c <_thumb\+0x88>\)
+ a28a: 4c01 ldr r4, \[pc, #4\] ; \(a290 <_thumb\+0x8c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for atf2
+#------------------------------------------------------------------------------
+ a28c: 0000008c \.word 0x0000008c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for atf2
+#------------------------------------------------------------------------------
+ a290: 00006dfc \.word 0x00006dfc
+#------------------------------------------------------------------------------
+#------ ttf2's .plt entry
+#------------------------------------------------------------------------------
+ a294: f7fe eece blx 9034 <atf3-0xec>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf2's .plt entry
+#------------------------------------------------------------------------------
+ a298: f7fe beca b\.w 9030 <atf3-0xf0>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf2's .plt entry
+#------------------------------------------------------------------------------
+ a29c: f43e aec8 beq\.w 9030 <atf3-0xf0>
+ a2a0: 4c00 ldr r4, \[pc, #0\] ; \(a2a4 <_thumb\+0xa0>\)
+ a2a2: 4c01 ldr r4, \[pc, #4\] ; \(a2a8 <_thumb\+0xa4>\)
+#------------------------------------------------------------------------------
+#------ .got offset for ttf2
+#------------------------------------------------------------------------------
+ a2a4: 00000094 \.word 0x00000094
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for ttf2
+#------------------------------------------------------------------------------
+ a2a8: 00006dec \.word 0x00006dec
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ a2ac: f7fe ef04 blx 90b8 <atf3-0x68>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf2's .plt entry
+#------------------------------------------------------------------------------
+ a2b0: f7fe bf00 b\.w 90b4 <atf3-0x6c>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf2's .plt entry
+#------------------------------------------------------------------------------
+ a2b4: f43e aefe beq\.w 90b4 <atf3-0x6c>
+ a2b8: 4c00 ldr r4, \[pc, #0\] ; \(a2bc <_thumb\+0xb8>\)
+ a2ba: 4c01 ldr r4, \[pc, #4\] ; \(a2c0 <_thumb\+0xbc>\)
+#------------------------------------------------------------------------------
+#------ .got offset for abf2
+#------------------------------------------------------------------------------
+ a2bc: 000000d0 \.word 0x000000d0
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf2
+#------------------------------------------------------------------------------
+ a2c0: 00006e10 \.word 0x00006e10
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a2c4: f7fe eebe blx 9044 <atf3-0xdc>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a2c8: f7fe beba b\.w 9040 <atf3-0xe0>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a2cc: f43e aeb8 beq\.w 9040 <atf3-0xe0>
+ a2d0: 4c00 ldr r4, \[pc, #0\] ; \(a2d4 <_thumb\+0xd0>\)
+ a2d2: 4c01 ldr r4, \[pc, #4\] ; \(a2d8 <_thumb\+0xd4>\)
+#------------------------------------------------------------------------------
+#------ .got offset for tbf2
+#------------------------------------------------------------------------------
+ a2d4: 00000098 \.word 0x00000098
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf2
+#------------------------------------------------------------------------------
+ a2d8: 00006dc0 \.word 0x00006dc0
+ a2dc: f7fe ef20 blx 9120 <atf3>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf3
+#------------------------------------------------------------------------------
+ a2e0: f7fe bf1c b\.w 911c <atf3-0x4>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf3
+#------------------------------------------------------------------------------
+ a2e4: f43e af1a beq\.w 911c <atf3-0x4>
+ a2e8: 4c00 ldr r4, \[pc, #0\] ; \(a2ec <_thumb\+0xe8>\)
+ a2ea: 4c01 ldr r4, \[pc, #4\] ; \(a2f0 <_thumb\+0xec>\)
+#------------------------------------------------------------------------------
+#------ .got offset for atf3
+#------------------------------------------------------------------------------
+ a2ec: 0000009c \.word 0x0000009c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for atf3
+#------------------------------------------------------------------------------
+ a2f0: 00006dac \.word 0x00006dac
+ a2f4: f7fe ef24 blx 9140 <ttf3>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf3
+#------------------------------------------------------------------------------
+ a2f8: f7fe bf20 b\.w 913c <abf3\+0xc>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf3
+#------------------------------------------------------------------------------
+ a2fc: f43e af1e beq\.w 913c <abf3\+0xc>
+ a300: 4c00 ldr r4, \[pc, #0\] ; \(a304 <_thumb\+0x100>\)
+ a302: 4c01 ldr r4, \[pc, #4\] ; \(a308 <_thumb\+0x104>\)
+#------------------------------------------------------------------------------
+#------ .got offset for ttf3
+#------------------------------------------------------------------------------
+ a304: 000000ac \.word 0x000000ac
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for ttf3
+#------------------------------------------------------------------------------
+ a308: 00006da4 \.word 0x00006da4
+ a30c: f7fe ef10 blx 9130 <abf3>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf3
+#------------------------------------------------------------------------------
+ a310: f7fe bf0c b\.w 912c <atf3\+0xc>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf3
+#------------------------------------------------------------------------------
+ a314: f43e af0a beq\.w 912c <atf3\+0xc>
+ a318: 4c00 ldr r4, \[pc, #0\] ; \(a31c <_thumb\+0x118>\)
+ a31a: 4c01 ldr r4, \[pc, #4\] ; \(a320 <_thumb\+0x11c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for abf3
+#------------------------------------------------------------------------------
+ a31c: 000000a0 \.word 0x000000a0
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf3
+#------------------------------------------------------------------------------
+ a320: 00006d80 \.word 0x00006d80
+ a324: f7fe ef14 blx 9150 <tbf3>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf3
+#------------------------------------------------------------------------------
+ a328: f7fe bf10 b\.w 914c <ttf3\+0xc>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf3
+#------------------------------------------------------------------------------
+ a32c: f43e af0e beq\.w 914c <ttf3\+0xc>
+ a330: 4c00 ldr r4, \[pc, #0\] ; \(a334 <_thumb\+0x130>\)
+ a332: 4c01 ldr r4, \[pc, #4\] ; \(a338 <_thumb\+0x134>\)
+#------------------------------------------------------------------------------
+#------ .got offset for tbf3
+#------------------------------------------------------------------------------
+ a334: 000000b0 \.word 0x000000b0
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf3
+#------------------------------------------------------------------------------
+ a338: 00006d78 \.word 0x00006d78
+#------------------------------------------------------------------------------
+#------ atf4's .plt entry
+#------------------------------------------------------------------------------
+ a33c: f7fe eeae blx 909c <atf3-0x84>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf4's .plt entry
+#------------------------------------------------------------------------------
+ a340: f7fe beaa b\.w 9098 <atf3-0x88>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf4's .plt entry
+#------------------------------------------------------------------------------
+ a344: f43e aea8 beq\.w 9098 <atf3-0x88>
+ a348: 4c00 ldr r4, \[pc, #0\] ; \(a34c <_thumb\+0x148>\)
+ a34a: 4c01 ldr r4, \[pc, #4\] ; \(a350 <_thumb\+0x14c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for atf4
+#------------------------------------------------------------------------------
+ a34c: 000000c8 \.word 0x000000c8
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for atf4
+#------------------------------------------------------------------------------
+ a350: 00006d78 \.word 0x00006d78
+#------------------------------------------------------------------------------
+#------ ttf4's .plt entry
+#------------------------------------------------------------------------------
+ a354: f7fe ee9a blx 908c <atf3-0x94>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf4's .plt entry
+#------------------------------------------------------------------------------
+ a358: f7fe be96 b\.w 9088 <atf3-0x98>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf4's .plt entry
+#------------------------------------------------------------------------------
+ a35c: f43e ae94 beq\.w 9088 <atf3-0x98>
+ a360: 4c00 ldr r4, \[pc, #0\] ; \(a364 <_thumb\+0x160>\)
+ a362: 4c01 ldr r4, \[pc, #4\] ; \(a368 <_thumb\+0x164>\)
+#------------------------------------------------------------------------------
+#------ .got offset for ttf4
+#------------------------------------------------------------------------------
+ a364: 000000c0 \.word 0x000000c0
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for ttf4
+#------------------------------------------------------------------------------
+ a368: 00006d58 \.word 0x00006d58
+#------------------------------------------------------------------------------
+#------ abf4's .plt entry
+#------------------------------------------------------------------------------
+ a36c: f7fe ee7e blx 906c <atf3-0xb4>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf4's .plt entry
+#------------------------------------------------------------------------------
+ a370: f7fe be7a b\.w 9068 <atf3-0xb8>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf4's .plt entry
+#------------------------------------------------------------------------------
+ a374: f43e ae78 beq\.w 9068 <atf3-0xb8>
+ a378: 4c00 ldr r4, \[pc, #0\] ; \(a37c <_thumb\+0x178>\)
+ a37a: 4c01 ldr r4, \[pc, #4\] ; \(a380 <_thumb\+0x17c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for abf4
+#------------------------------------------------------------------------------
+ a37c: 000000b8 \.word 0x000000b8
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf4
+#------------------------------------------------------------------------------
+ a380: 00006d38 \.word 0x00006d38
+#------------------------------------------------------------------------------
+#------ tbf4's .plt entry
+#------------------------------------------------------------------------------
+ a384: f7fe ee7a blx 907c <atf3-0xa4>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf4's .plt entry
+#------------------------------------------------------------------------------
+ a388: f7fe be76 b\.w 9078 <atf3-0xa8>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf4's .plt entry
+#------------------------------------------------------------------------------
+ a38c: f43e ae74 beq\.w 9078 <atf3-0xa8>
+ a390: 4c00 ldr r4, \[pc, #0\] ; \(a394 <_thumb\+0x190>\)
+ a392: 4c01 ldr r4, \[pc, #4\] ; \(a398 <_thumb\+0x194>\)
+#------------------------------------------------------------------------------
+#------ .got offset for tbf4
+#------------------------------------------------------------------------------
+ a394: 000000bc \.word 0x000000bc
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf4
+#------------------------------------------------------------------------------
+ a398: 00006d24 \.word 0x00006d24
diff --git a/ld/testsuite/ld-arm/ifunc-10.gd b/ld/testsuite/ld-arm/ifunc-10.gd
new file mode 100644
index 0000000000..be3e09fd07
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-10.gd
@@ -0,0 +1,188 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------ 00010004: contains aaf1's .iplt entry
+#------ 00010008: contains PC-relative offset of aaf1's .iplt entry
+#------ 0001000c: contains atf1's .iplt entry
+#------------------------------------------------------------------------------
+ 10000 44332211 c4900000 bc90ffff d4900000 .*
+#------------------------------------------------------------------------------
+#------ 00010010: contains PC-relative offset of atf1's .iplt entry
+#------ 00010014: contains abf1's .iplt entry
+#------ 00010018: contains PC-relative offset of abf1's .iplt entry
+#------ 0001001c: contains taf1's .iplt entry
+#------------------------------------------------------------------------------
+ 10010 c490ffff e4900000 cc90ffff f0900000 .*
+#------------------------------------------------------------------------------
+#------ 00010020: contains PC-relative offset of taf1's .iplt entry
+#------ 00010024: contains ttf1's .iplt entry
+#------ 00010028: contains PC-relative offset of ttf1's .iplt entry
+#------ 0001002c: contains tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ 10020 d090ffff 00910000 d890ffff 10910000 .*
+#------------------------------------------------------------------------------
+#------ 00010030: contains PC-relative offset of tbf1's .iplt entry
+#------ 00010034: contains aaf2's .plt entry
+#------ 00010038: contains PC-relative offset of aaf2's .plt entry
+#------ 0001003c: contains atf2's .plt entry
+#------------------------------------------------------------------------------
+ 10030 e090ffff 5c900000 2490ffff 18900000 .*
+#------------------------------------------------------------------------------
+#------ 00010040: contains PC-relative offset of atf2's .plt entry
+#------ 00010044: contains abf2's .plt entry
+#------ 00010048: contains PC-relative offset of abf2's .plt entry
+#------ 0001004c: contains taf2's .plt entry
+#------------------------------------------------------------------------------
+ 10040 d88fffff b8900000 7090ffff 50900000 .*
+#------------------------------------------------------------------------------
+#------ 00010050: contains PC-relative offset of taf2's .plt entry
+#------ 00010054: contains ttf2's .plt entry
+#------ 00010058: contains PC-relative offset of ttf2's .plt entry
+#------ 0001005c: contains tbf2's .plt entry
+#------------------------------------------------------------------------------
+ 10050 0090ffff 34900000 dc8fffff 44900000 .*
+#------------------------------------------------------------------------------
+#------ 00010060: contains PC-relative offset of tbf2's .plt entry
+#------ 00010064: contains aaf3
+#------ 00010068: contains PC-relative offset of aaf3
+#------ 0001006c: contains atf3
+#------------------------------------------------------------------------------
+ 10060 e48fffff 68910000 0091ffff 20910000 .*
+#------------------------------------------------------------------------------
+#------ 00010070: contains PC-relative offset of atf3
+#------ 00010074: contains abf3
+#------ 00010078: contains PC-relative offset of abf3
+#------ 0001007c: contains taf3
+#------------------------------------------------------------------------------
+ 10070 b090ffff 30910000 b890ffff 5c910000 .*
+#------------------------------------------------------------------------------
+#------ 00010080: contains PC-relative offset of taf3
+#------ 00010084: contains ttf3
+#------ 00010088: contains PC-relative offset of ttf3
+#------ 0001008c: contains tbf3
+#------------------------------------------------------------------------------
+ 10080 dc90ffff 40910000 b890ffff 50910000 .*
+#------------------------------------------------------------------------------
+#------ 00010090: contains PC-relative offset of tbf3
+#------ 00010094: contains aaf4's .plt entry
+#------ 00010098: contains PC-relative offset of aaf4's .plt entry
+#------ 0001009c: contains atf4's .plt entry
+#------------------------------------------------------------------------------
+ 10090 c090ffff 24900000 8c8fffff 9c900000 .*
+#------------------------------------------------------------------------------
+#------ 000100a0: contains PC-relative offset of atf4's .plt entry
+#------ 000100a4: contains abf4's .plt entry
+#------ 000100a8: contains PC-relative offset of abf4's .plt entry
+#------ 000100ac: contains taf4's .plt entry
+#------------------------------------------------------------------------------
+ 100a0 fc8fffff 6c900000 c48fffff a8900000 .*
+#------------------------------------------------------------------------------
+#------ 000100b0: contains PC-relative offset of taf4's .plt entry
+#------ 000100b4: contains ttf4's .plt entry
+#------ 000100b8: contains PC-relative offset of ttf4's .plt entry
+#------ 000100bc: contains tbf4's .plt entry
+#------------------------------------------------------------------------------
+ 100b0 f88fffff 8c900000 d48fffff 7c900000 .*
+#------------------------------------------------------------------------------
+#------ 000100c0: contains PC-relative offset of tbf4's .plt entry
+#------------------------------------------------------------------------------
+ 100c0 bc8fffff .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: atf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11000 00200100 00000000 00000000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: aaf4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011014: ttf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011018: tbf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 0001101c: taf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11010 00900000 00900000 00900000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011020: aaf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011024: abf4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011028: tbf4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 0001102c: ttf4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11020 00900000 00900000 00900000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011030: atf4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011034: taf4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011038: abf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 0001103c: aaf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11030 00900000 00900000 00900000 00a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011040: atf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011044: abf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011048: taf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001104c: ttf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11040 04a00000 08a00000 0da00000 0fa00000 .*
+#------------------------------------------------------------------------------
+#------ 00011050: tbf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011054: atf3's .igot.plt pointer to 0xa018 [R_ARM_IRELATIVE]
+#------ 00011058: abf3's .igot.plt pointer to 0xa01c [R_ARM_IRELATIVE]
+#------ 0001105c: ttf3's .igot.plt pointer to 0xa023 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11050 11a00000 18a00000 1ca00000 23a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011060: tbf3's .igot.plt pointer to 0xa025 [R_ARM_IRELATIVE]
+#------ 00011064: taf3's .igot.plt pointer to 0xa021 [R_ARM_IRELATIVE]
+#------ 00011068: aaf3's .igot.plt pointer to 0xa014 [R_ARM_IRELATIVE]
+#------ 0001106c: .got entry for foo
+#------------------------------------------------------------------------------
+ 11060 25a00000 21a00000 14a00000 00000100 .*
+#------------------------------------------------------------------------------
+#------ 00011070: .got entry for aaf1's .iplt entry
+#------ 00011074: .got entry for atf1's .iplt entry
+#------ 00011078: .got entry for abf1's .iplt entry
+#------ 0001107c: .got entry for taf1's .iplt entry
+#------------------------------------------------------------------------------
+ 11070 c4900000 d4900000 e4900000 f0900000 .*
+#------------------------------------------------------------------------------
+#------ 00011080: .got entry for ttf1's .iplt entry
+#------ 00011084: .got entry for tbf1's .iplt entry
+#------ 00011088: .got entry for foo
+#------ 0001108c: .got entry for atf2 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 11080 00910000 10910000 00000100 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00011090: .got entry for aaf4 [R_ARM_GLOB_DAT]
+#------ 00011094: .got entry for ttf2 [R_ARM_GLOB_DAT]
+#------ 00011098: .got entry for tbf2 [R_ARM_GLOB_DAT]
+#------ 0001109c: .got entry for atf3
+#------------------------------------------------------------------------------
+ 11090 00000000 00000000 00000000 20910000 .*
+#------------------------------------------------------------------------------
+#------ 000110a0: .got entry for abf3
+#------ 000110a4: .got entry for taf2 [R_ARM_GLOB_DAT]
+#------ 000110a8: .got entry for aaf2 [R_ARM_GLOB_DAT]
+#------ 000110ac: .got entry for ttf3
+#------------------------------------------------------------------------------
+ 110a0 30910000 00000000 00000000 40910000 .*
+#------------------------------------------------------------------------------
+#------ 000110b0: .got entry for tbf3
+#------ 000110b4: .got entry for taf3
+#------ 000110b8: .got entry for abf4 [R_ARM_GLOB_DAT]
+#------ 000110bc: .got entry for tbf4 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 110b0 50910000 5c910000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 000110c0: .got entry for ttf4 [R_ARM_GLOB_DAT]
+#------ 000110c4: .got entry for aaf3
+#------ 000110c8: .got entry for atf4 [R_ARM_GLOB_DAT]
+#------ 000110cc: .got entry for taf4 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 110c0 00000000 68910000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 000110d0: .got entry for abf2 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 110d0 00000000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-10.rd b/ld/testsuite/ld-arm/ifunc-10.rd
new file mode 100644
index 0000000000..8846197678
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-10.rd
@@ -0,0 +1,42 @@
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 24 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001103c ......a0 R_ARM_IRELATIVE
+00011040 ......a0 R_ARM_IRELATIVE
+00011044 ......a0 R_ARM_IRELATIVE
+00011048 ......a0 R_ARM_IRELATIVE
+0001104c ......a0 R_ARM_IRELATIVE
+00011050 ......a0 R_ARM_IRELATIVE
+00011054 ......a0 R_ARM_IRELATIVE
+00011058 ......a0 R_ARM_IRELATIVE
+0001105c ......a0 R_ARM_IRELATIVE
+00011060 ......a0 R_ARM_IRELATIVE
+00011064 ......a0 R_ARM_IRELATIVE
+00011068 ......a0 R_ARM_IRELATIVE
+0001108c ......15 R_ARM_GLOB_DAT 00009018 atf2
+00011090 ......15 R_ARM_GLOB_DAT 00009024 aaf4
+00011094 ......15 R_ARM_GLOB_DAT 00009034 ttf2
+00011098 ......15 R_ARM_GLOB_DAT 00009044 tbf2
+000110a4 ......15 R_ARM_GLOB_DAT 00009050 taf2
+000110a8 ......15 R_ARM_GLOB_DAT 0000905c aaf2
+000110b8 ......15 R_ARM_GLOB_DAT 0000906c abf4
+000110bc ......15 R_ARM_GLOB_DAT 0000907c tbf4
+000110c0 ......15 R_ARM_GLOB_DAT 0000908c ttf4
+000110c8 ......15 R_ARM_GLOB_DAT 0000909c atf4
+000110cc ......15 R_ARM_GLOB_DAT 000090a8 taf4
+000110d0 ......15 R_ARM_GLOB_DAT 000090b8 abf2
+
+Relocation section '\.rel\.plt' at offset 0x80c0 contains 12 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......16 R_ARM_JUMP_SLOT 00009018 atf2
+00011010 ......16 R_ARM_JUMP_SLOT 00009024 aaf4
+00011014 ......16 R_ARM_JUMP_SLOT 00009034 ttf2
+00011018 ......16 R_ARM_JUMP_SLOT 00009044 tbf2
+0001101c ......16 R_ARM_JUMP_SLOT 00009050 taf2
+00011020 ......16 R_ARM_JUMP_SLOT 0000905c aaf2
+00011024 ......16 R_ARM_JUMP_SLOT 0000906c abf4
+00011028 ......16 R_ARM_JUMP_SLOT 0000907c tbf4
+0001102c ......16 R_ARM_JUMP_SLOT 0000908c ttf4
+00011030 ......16 R_ARM_JUMP_SLOT 0000909c atf4
+00011034 ......16 R_ARM_JUMP_SLOT 000090a8 taf4
+00011038 ......16 R_ARM_JUMP_SLOT 000090b8 abf2
diff --git a/ld/testsuite/ld-arm/ifunc-10.s b/ld/testsuite/ld-arm/ifunc-10.s
new file mode 100644
index 0000000000..5b1912f367
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-10.s
@@ -0,0 +1,90 @@
+ .syntax unified
+ .arch armv6t2
+
+ .macro define,name,type
+ .type \name,%gnu_indirect_function
+ \type
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro define2,name
+ define aa\name,.arm
+ define at\name,.arm
+ define ab\name,.arm
+ define ta\name,.thumb_func
+ define tt\name,.thumb_func
+ define tb\name,.thumb_func
+ .endm
+
+ .macro test_relocs,name,width
+ bl \name(PLT)
+ b\width \name
+ beq\width \name
+ ldr r4,1f
+ ldr r4,2f
+1:
+ .word \name(GOT)
+2:
+ .word \name(GOT_PREL)
+ .endm
+
+ .macro test_relocs2,name,type,width
+ test_relocs a\type\name,\width
+ test_relocs t\type\name,\width
+ test_relocs ab\name,\width
+ test_relocs tb\name,\width
+ .endm
+
+ .macro diff,name
+ .word \name
+ .word \name-.
+ .endm
+
+ .macro alldirs,doit,name
+ \doit aa\name
+ \doit at\name
+ \doit ab\name
+ \doit ta\name
+ \doit tt\name
+ \doit tb\name
+ .endm
+
+ define2 f1
+ # f2 provided by ifunc-4.so
+ define2 f3
+ # f4 provided by ifunc-4.so
+
+ alldirs .globl,f3
+ alldirs .hidden,f3
+
+ .globl _start
+ .type _start,%function
+ .arm
+_start:
+ test_relocs foo
+ test_relocs2 f1,a,
+ test_relocs2 f2,a,
+ test_relocs2 f3,a,
+ test_relocs2 f4,a,
+ .size _start,.-_start
+
+ .globl _thumb
+ .type _thumb,%function
+ .thumb_func
+_thumb:
+ test_relocs foo
+ test_relocs2 f1,t,.w
+ test_relocs2 f2,t,.w
+ test_relocs2 f3,t,.w
+ test_relocs2 f4,t,.w
+ .size _thumb,.-_thumb
+
+ .data
+foo:
+ .word 0x11223344
+ alldirs diff,f1
+ alldirs diff,f2
+ alldirs diff,f3
+ alldirs diff,f4
diff --git a/ld/testsuite/ld-arm/ifunc-11.dd b/ld/testsuite/ld-arm/ifunc-11.dd
new file mode 100644
index 0000000000..89a7530594
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-11.dd
@@ -0,0 +1,95 @@
+
+.*
+
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+
+0000a004 <f2>:
+ a004: e1a0f00e mov pc, lr
+
+0000a008 <f3>:
+ a008: e1a0f00e mov pc, lr
+
+0000a00c <f1t>:
+ a00c: 46f7 mov pc, lr
+
+0000a00e <f2t>:
+ a00e: 46f7 mov pc, lr
+
+0000a010 <f3t>:
+ a010: 46f7 mov pc, lr
+
+0000a012 <_start>:
+ a012: f8df 4004 ldr\.w r4, \[pc, #4\] ; a018 <_start\+0x6>
+ a016: 4c01 ldr r4, \[pc, #4\] ; \(a01c <_start\+0xa>\)
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a018: 00000018 \.word 0x00000018
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a01c: 00006ff0 \.word 0x00006ff0
+ a020: 4c00 ldr r4, \[pc, #0\] ; \(a024 <_start\+0x12>\)
+ a022: 4c01 ldr r4, \[pc, #4\] ; \(a028 <_start\+0x16>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f1
+#------------------------------------------------------------------------------
+ a024: 00000010 \.word 0x00000010
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f1
+#------------------------------------------------------------------------------
+ a028: 00006fe8 \.word 0x00006fe8
+ a02c: 4c00 ldr r4, \[pc, #0\] ; \(a030 <_start\+0x1e>\)
+ a02e: 4c01 ldr r4, \[pc, #4\] ; \(a034 <_start\+0x22>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f2
+#------------------------------------------------------------------------------
+ a030: 00000024 \.word 0x00000024
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f2
+#------------------------------------------------------------------------------
+ a034: 00006ff0 \.word 0x00006ff0
+ a038: 4c00 ldr r4, \[pc, #0\] ; \(a03c <_start\+0x2a>\)
+ a03a: 4c01 ldr r4, \[pc, #4\] ; \(a040 <_start\+0x2e>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f3
+#------------------------------------------------------------------------------
+ a03c: 00000020 \.word 0x00000020
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f3
+#------------------------------------------------------------------------------
+ a040: 00006fe0 \.word 0x00006fe0
+ a044: 4c00 ldr r4, \[pc, #0\] ; \(a048 <_start\+0x36>\)
+ a046: 4c01 ldr r4, \[pc, #4\] ; \(a04c <_start\+0x3a>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f1t
+#------------------------------------------------------------------------------
+ a048: 00000014 \.word 0x00000014
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f1t
+#------------------------------------------------------------------------------
+ a04c: 00006fc8 \.word 0x00006fc8
+ a050: 4c00 ldr r4, \[pc, #0\] ; \(a054 <_start\+0x42>\)
+ a052: 4c01 ldr r4, \[pc, #4\] ; \(a058 <_start\+0x46>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f2t
+#------------------------------------------------------------------------------
+ a054: 0000001c \.word 0x0000001c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f2t
+#------------------------------------------------------------------------------
+ a058: 00006fc4 \.word 0x00006fc4
+ a05c: 4c00 ldr r4, \[pc, #0\] ; \(a060 <_start\+0x4e>\)
+ a05e: 4c01 ldr r4, \[pc, #4\] ; \(a064 <_start\+0x52>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f3t
+#------------------------------------------------------------------------------
+ a060: 00000028 \.word 0x00000028
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f3t
+#------------------------------------------------------------------------------
+ a064: 00006fc4 \.word 0x00006fc4
diff --git a/ld/testsuite/ld-arm/ifunc-11.gd b/ld/testsuite/ld-arm/ifunc-11.gd
new file mode 100644
index 0000000000..aea1583015
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-11.gd
@@ -0,0 +1,29 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------------------------------------------------------------------------------
+ 10000 44332211 00800000 30800000 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: .got entry for foo
+#------------------------------------------------------------------------------
+ 11000 00000000 00000000 00000000 00000100 .*
+#------------------------------------------------------------------------------
+#------ 00011010: .got entry for f1 [R_ARM_IRELATIVE]
+#------ 00011014: .got entry for f1t [R_ARM_IRELATIVE]
+#------ 00011018: .got entry for foo
+#------ 0001101c: .got entry for f2t [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11010 00a00000 0da00000 00000100 0fa00000 .*
+#------------------------------------------------------------------------------
+#------ 00011020: .got entry for f3 [R_ARM_IRELATIVE]
+#------ 00011024: .got entry for f2 [R_ARM_IRELATIVE]
+#------ 00011028: .got entry for f3t [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11020 08a00000 04a00000 11a00000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-11.rd b/ld/testsuite/ld-arm/ifunc-11.rd
new file mode 100644
index 0000000000..82ce9b7112
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-11.rd
@@ -0,0 +1,11 @@
+
+There is no dynamic section in this file\.
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 6 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+00011010 ......a0 R_ARM_IRELATIVE
+00011024 ......a0 R_ARM_IRELATIVE
+00011020 ......a0 R_ARM_IRELATIVE
+00011014 ......a0 R_ARM_IRELATIVE
+0001101c ......a0 R_ARM_IRELATIVE
+00011028 ......a0 R_ARM_IRELATIVE
diff --git a/ld/testsuite/ld-arm/ifunc-11.s b/ld/testsuite/ld-arm/ifunc-11.s
new file mode 100644
index 0000000000..36ebc24d63
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-11.s
@@ -0,0 +1,52 @@
+ .syntax unified
+ .arch armv6t2
+
+ .macro define,name,type
+ .type \name,%gnu_indirect_function
+ \type
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name
+ ldr r4,1f
+ ldr r4,2f
+1:
+ .word \name(GOT)
+2:
+ .word \name(GOT_PREL)
+ .endm
+
+ .global f2
+ .global f2t
+
+ .global f3
+ .hidden f3
+ .global f3t
+ .hidden f3t
+
+ define f1,.arm
+ define f2,.arm
+ define f3,.arm
+
+ define f1t,.thumb_func
+ define f2t,.thumb_func
+ define f3t,.thumb_func
+
+ .globl _start
+_start:
+ test_relocs foo
+ test_relocs f1
+ test_relocs f2
+ test_relocs f3
+ test_relocs f1t
+ test_relocs f2t
+ test_relocs f3t
+ .size _start,.-_start
+
+ .data
+foo:
+ .word 0x11223344
+ .word __irel_start
+ .word __irel_end
diff --git a/ld/testsuite/ld-arm/ifunc-12.dd b/ld/testsuite/ld-arm/ifunc-12.dd
new file mode 100644
index 0000000000..89a7530594
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-12.dd
@@ -0,0 +1,95 @@
+
+.*
+
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+
+0000a004 <f2>:
+ a004: e1a0f00e mov pc, lr
+
+0000a008 <f3>:
+ a008: e1a0f00e mov pc, lr
+
+0000a00c <f1t>:
+ a00c: 46f7 mov pc, lr
+
+0000a00e <f2t>:
+ a00e: 46f7 mov pc, lr
+
+0000a010 <f3t>:
+ a010: 46f7 mov pc, lr
+
+0000a012 <_start>:
+ a012: f8df 4004 ldr\.w r4, \[pc, #4\] ; a018 <_start\+0x6>
+ a016: 4c01 ldr r4, \[pc, #4\] ; \(a01c <_start\+0xa>\)
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a018: 00000018 \.word 0x00000018
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a01c: 00006ff0 \.word 0x00006ff0
+ a020: 4c00 ldr r4, \[pc, #0\] ; \(a024 <_start\+0x12>\)
+ a022: 4c01 ldr r4, \[pc, #4\] ; \(a028 <_start\+0x16>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f1
+#------------------------------------------------------------------------------
+ a024: 00000010 \.word 0x00000010
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f1
+#------------------------------------------------------------------------------
+ a028: 00006fe8 \.word 0x00006fe8
+ a02c: 4c00 ldr r4, \[pc, #0\] ; \(a030 <_start\+0x1e>\)
+ a02e: 4c01 ldr r4, \[pc, #4\] ; \(a034 <_start\+0x22>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f2
+#------------------------------------------------------------------------------
+ a030: 00000024 \.word 0x00000024
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f2
+#------------------------------------------------------------------------------
+ a034: 00006ff0 \.word 0x00006ff0
+ a038: 4c00 ldr r4, \[pc, #0\] ; \(a03c <_start\+0x2a>\)
+ a03a: 4c01 ldr r4, \[pc, #4\] ; \(a040 <_start\+0x2e>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f3
+#------------------------------------------------------------------------------
+ a03c: 00000020 \.word 0x00000020
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f3
+#------------------------------------------------------------------------------
+ a040: 00006fe0 \.word 0x00006fe0
+ a044: 4c00 ldr r4, \[pc, #0\] ; \(a048 <_start\+0x36>\)
+ a046: 4c01 ldr r4, \[pc, #4\] ; \(a04c <_start\+0x3a>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f1t
+#------------------------------------------------------------------------------
+ a048: 00000014 \.word 0x00000014
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f1t
+#------------------------------------------------------------------------------
+ a04c: 00006fc8 \.word 0x00006fc8
+ a050: 4c00 ldr r4, \[pc, #0\] ; \(a054 <_start\+0x42>\)
+ a052: 4c01 ldr r4, \[pc, #4\] ; \(a058 <_start\+0x46>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f2t
+#------------------------------------------------------------------------------
+ a054: 0000001c \.word 0x0000001c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f2t
+#------------------------------------------------------------------------------
+ a058: 00006fc4 \.word 0x00006fc4
+ a05c: 4c00 ldr r4, \[pc, #0\] ; \(a060 <_start\+0x4e>\)
+ a05e: 4c01 ldr r4, \[pc, #4\] ; \(a064 <_start\+0x52>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f3t
+#------------------------------------------------------------------------------
+ a060: 00000028 \.word 0x00000028
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f3t
+#------------------------------------------------------------------------------
+ a064: 00006fc4 \.word 0x00006fc4
diff --git a/ld/testsuite/ld-arm/ifunc-12.gd b/ld/testsuite/ld-arm/ifunc-12.gd
new file mode 100644
index 0000000000..721c3154fd
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-12.gd
@@ -0,0 +1,39 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------ 00010004: contains f1 [R_ARM_IRELATIVE]
+#------ 00010008: f2 [R_ARM_ABS32]
+#------ 0001000c: contains f3 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10000 44332211 00a00000 00000000 08a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010010: contains f1t [R_ARM_IRELATIVE]
+#------ 00010014: f2t [R_ARM_ABS32]
+#------ 00010018: contains f3t [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10010 0da00000 00000000 11a00000 80800000 .*
+ 10020 80800000 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: .got entry for foo [R_ARM_RELATIVE]
+#------------------------------------------------------------------------------
+ 11000 00200100 00000000 00000000 00000100 .*
+#------------------------------------------------------------------------------
+#------ 00011010: .got entry for f1 [R_ARM_IRELATIVE]
+#------ 00011014: .got entry for f1t [R_ARM_IRELATIVE]
+#------ 00011018: .got entry for foo [R_ARM_RELATIVE]
+#------ 0001101c: .got entry for f2t [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 11010 00a00000 0da00000 00000100 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00011020: .got entry for f3 [R_ARM_IRELATIVE]
+#------ 00011024: .got entry for f2 [R_ARM_GLOB_DAT]
+#------ 00011028: .got entry for f3t [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11020 08a00000 00000000 11a00000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-12.rd b/ld/testsuite/ld-arm/ifunc-12.rd
new file mode 100644
index 0000000000..c5d62c1ac5
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-12.rd
@@ -0,0 +1,19 @@
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 16 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001001c ......17 R_ARM_RELATIVE
+00010020 ......17 R_ARM_RELATIVE
+0001100c ......17 R_ARM_RELATIVE
+00011018 ......17 R_ARM_RELATIVE
+00010004 ......a0 R_ARM_IRELATIVE
+0001000c ......a0 R_ARM_IRELATIVE
+00010010 ......a0 R_ARM_IRELATIVE
+00010018 ......a0 R_ARM_IRELATIVE
+00011010 ......a0 R_ARM_IRELATIVE
+00011014 ......a0 R_ARM_IRELATIVE
+00011020 ......a0 R_ARM_IRELATIVE
+00011028 ......a0 R_ARM_IRELATIVE
+00010008 ......02 R_ARM_ABS32 f2\(\) f2
+00011024 ......15 R_ARM_GLOB_DAT f2\(\) f2
+00010014 ......02 R_ARM_ABS32 f2t\(\) f2t
+0001101c ......15 R_ARM_GLOB_DAT f2t\(\) f2t
diff --git a/ld/testsuite/ld-arm/ifunc-12.s b/ld/testsuite/ld-arm/ifunc-12.s
new file mode 100644
index 0000000000..388ac34c26
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-12.s
@@ -0,0 +1,58 @@
+ .syntax unified
+ .arch armv6t2
+
+ .macro define,name,type
+ .type \name,%gnu_indirect_function
+ \type
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name
+ ldr r4,1f
+ ldr r4,2f
+1:
+ .word \name(GOT)
+2:
+ .word \name(GOT_PREL)
+ .endm
+
+ .global f2
+ .global f2t
+
+ .global f3
+ .hidden f3
+ .global f3t
+ .hidden f3t
+
+ define f1,.arm
+ define f2,.arm
+ define f3,.arm
+
+ define f1t,.thumb_func
+ define f2t,.thumb_func
+ define f3t,.thumb_func
+
+ .globl _start
+_start:
+ test_relocs foo
+ test_relocs f1
+ test_relocs f2
+ test_relocs f3
+ test_relocs f1t
+ test_relocs f2t
+ test_relocs f3t
+ .size _start,.-_start
+
+ .data
+foo:
+ .word 0x11223344
+ .word f1
+ .word f2
+ .word f3
+ .word f1t
+ .word f2t
+ .word f3t
+ .word __irel_start
+ .word __irel_end
diff --git a/ld/testsuite/ld-arm/ifunc-13.dd b/ld/testsuite/ld-arm/ifunc-13.dd
new file mode 100644
index 0000000000..d5df382048
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-13.dd
@@ -0,0 +1,89 @@
+
+.*
+
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+
+0000a004 <f3>:
+ a004: e1a0f00e mov pc, lr
+
+0000a008 <f1t>:
+ a008: 46f7 mov pc, lr
+
+0000a00a <f3t>:
+ a00a: 46f7 mov pc, lr
+
+0000a00c <_start>:
+ a00c: 4c00 ldr r4, \[pc, #0\] ; \(a010 <_start\+0x4>\)
+ a00e: 4c01 ldr r4, \[pc, #4\] ; \(a014 <_start\+0x8>\)
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a010: 00000018 \.word 0x00000018
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a014: 00006ff8 \.word 0x00006ff8
+ a018: 4c00 ldr r4, \[pc, #0\] ; \(a01c <_start\+0x10>\)
+ a01a: 4c01 ldr r4, \[pc, #4\] ; \(a020 <_start\+0x14>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f1
+#------------------------------------------------------------------------------
+ a01c: 00000010 \.word 0x00000010
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f1
+#------------------------------------------------------------------------------
+ a020: 00006ff0 \.word 0x00006ff0
+ a024: 4c00 ldr r4, \[pc, #0\] ; \(a028 <_start\+0x1c>\)
+ a026: 4c01 ldr r4, \[pc, #4\] ; \(a02c <_start\+0x20>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f2
+#------------------------------------------------------------------------------
+ a028: 00000024 \.word 0x00000024
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f2
+#------------------------------------------------------------------------------
+ a02c: 00006ff8 \.word 0x00006ff8
+ a030: 4c00 ldr r4, \[pc, #0\] ; \(a034 <_start\+0x28>\)
+ a032: 4c01 ldr r4, \[pc, #4\] ; \(a038 <_start\+0x2c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f3
+#------------------------------------------------------------------------------
+ a034: 00000020 \.word 0x00000020
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f3
+#------------------------------------------------------------------------------
+ a038: 00006fe8 \.word 0x00006fe8
+ a03c: 4c00 ldr r4, \[pc, #0\] ; \(a040 <_start\+0x34>\)
+ a03e: 4c01 ldr r4, \[pc, #4\] ; \(a044 <_start\+0x38>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f1t
+#------------------------------------------------------------------------------
+ a040: 00000014 \.word 0x00000014
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f1t
+#------------------------------------------------------------------------------
+ a044: 00006fd0 \.word 0x00006fd0
+ a048: 4c00 ldr r4, \[pc, #0\] ; \(a04c <_start\+0x40>\)
+ a04a: 4c01 ldr r4, \[pc, #4\] ; \(a050 <_start\+0x44>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f2t
+#------------------------------------------------------------------------------
+ a04c: 0000001c \.word 0x0000001c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f2t
+#------------------------------------------------------------------------------
+ a050: 00006fcc \.word 0x00006fcc
+ a054: 4c00 ldr r4, \[pc, #0\] ; \(a058 <_start\+0x4c>\)
+ a056: 4c01 ldr r4, \[pc, #4\] ; \(a05c <_start\+0x50>\)
+#------------------------------------------------------------------------------
+#------ .got offset for f3t
+#------------------------------------------------------------------------------
+ a058: 00000028 \.word 0x00000028
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f3t
+#------------------------------------------------------------------------------
+ a05c: 00006fcc \.word 0x00006fcc
diff --git a/ld/testsuite/ld-arm/ifunc-13.gd b/ld/testsuite/ld-arm/ifunc-13.gd
new file mode 100644
index 0000000000..9b5dbcb8c9
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-13.gd
@@ -0,0 +1,29 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------------------------------------------------------------------------------
+ 10000 44332211 30800000 30800000 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: .got entry for foo
+#------------------------------------------------------------------------------
+ 11000 00200100 00000000 00000000 00000100 .*
+#------------------------------------------------------------------------------
+#------ 00011010: .got entry for f1 [R_ARM_IRELATIVE]
+#------ 00011014: .got entry for f1t [R_ARM_IRELATIVE]
+#------ 00011018: .got entry for foo
+#------ 0001101c: .got entry for f2t [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 11010 00a00000 09a00000 00000100 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00011020: .got entry for f3 [R_ARM_IRELATIVE]
+#------ 00011024: .got entry for f2 [R_ARM_GLOB_DAT]
+#------ 00011028: .got entry for f3t [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11020 04a00000 00000000 0ba00000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-13.rd b/ld/testsuite/ld-arm/ifunc-13.rd
new file mode 100644
index 0000000000..c58ab8ac94
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-13.rd
@@ -0,0 +1,9 @@
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 6 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+00011010 ......a0 R_ARM_IRELATIVE
+00011014 ......a0 R_ARM_IRELATIVE
+00011020 ......a0 R_ARM_IRELATIVE
+00011028 ......a0 R_ARM_IRELATIVE
+0001101c ......15 R_ARM_GLOB_DAT 00000000 f2t
+00011024 ......15 R_ARM_GLOB_DAT 00000000 f2
diff --git a/ld/testsuite/ld-arm/ifunc-13.s b/ld/testsuite/ld-arm/ifunc-13.s
new file mode 100644
index 0000000000..467f06f105
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-13.s
@@ -0,0 +1,50 @@
+ .syntax unified
+ .arch armv6t2
+
+ .macro define,name,type
+ .type \name,%gnu_indirect_function
+ \type
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name
+ ldr r4,1f
+ ldr r4,2f
+1:
+ .word \name(GOT)
+2:
+ .word \name(GOT_PREL)
+ .endm
+
+ .global f2
+ .global f2t
+
+ .global f3
+ .hidden f3
+ .global f3t
+ .hidden f3t
+
+ define f1,.arm
+ define f3,.arm
+
+ define f1t,.thumb_func
+ define f3t,.thumb_func
+
+ .globl _start
+_start:
+ test_relocs foo
+ test_relocs f1
+ test_relocs f2
+ test_relocs f3
+ test_relocs f1t
+ test_relocs f2t
+ test_relocs f3t
+ .size _start,.-_start
+
+ .data
+foo:
+ .word 0x11223344
+ .word __irel_start
+ .word __irel_end
diff --git a/ld/testsuite/ld-arm/ifunc-14.dd b/ld/testsuite/ld-arm/ifunc-14.dd
new file mode 100644
index 0000000000..8df338a545
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-14.dd
@@ -0,0 +1,100 @@
+
+.*
+
+
+Disassembly of section \.plt:
+
+00009000 <\.plt>:
+ 9000: e52de004 push {lr} ; \(str lr, \[sp, #-4\]!\)
+ 9004: e59fe004 ldr lr, \[pc, #4\] ; 9010 <__irel_end\+0xff0>
+ 9008: e08fe00e add lr, pc, lr
+ 900c: e5bef008 ldr pc, \[lr, #8\]!
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got.plt
+#------------------------------------------------------------------------------
+ 9010: 00007ff0 \.word 0x00007ff0
+#------------------------------------------------------------------------------
+#------ f2t's .plt entry
+#------------------------------------------------------------------------------
+ 9014: e28fc600 add ip, pc, #0
+ 9018: e28cca07 add ip, ip, #28672 ; 0x7000
+ 901c: e5bcfff0 ldr pc, \[ip, #4080\]! ; 0xff0
+#------------------------------------------------------------------------------
+#------ f2's .plt entry
+#------------------------------------------------------------------------------
+ 9020: e28fc600 add ip, pc, #0
+ 9024: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9028: e5bcffe8 ldr pc, \[ip, #4072\]! ; 0xfe8
+
+Disassembly of section \.iplt:
+
+0000902c <f3-0x18>:
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ 902c: e28fc600 add ip, pc, #0
+ 9030: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9034: e5bcffe0 ldr pc, \[ip, #4064\]! ; 0xfe0
+#------------------------------------------------------------------------------
+#------ f1t's .iplt entry
+#------------------------------------------------------------------------------
+ 9038: e28fc600 add ip, pc, #0
+ 903c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9040: e5bcffd8 ldr pc, \[ip, #4056\]! ; 0xfd8
+
+00009044 <f3>:
+ 9044: e28fc600 add ip, pc, #0
+ 9048: e28cca07 add ip, ip, #28672 ; 0x7000
+ 904c: e5bcffd0 ldr pc, \[ip, #4048\]! ; 0xfd0
+
+00009050 <f3t>:
+ 9050: e28fc600 add ip, pc, #0
+ 9054: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9058: e5bcffc8 ldr pc, \[ip, #4040\]! ; 0xfc8
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+ a004: e1a0f00e mov pc, lr
+
+0000a008 <f1t>:
+ a008: 46f7 mov pc, lr
+ a00a: 46f7 mov pc, lr
+
+0000a00c <_start>:
+ a00c: f8df 4000 ldr\.w r4, \[pc\] ; a010 <_start\+0x4>
+#------------------------------------------------------------------------------
+#------ PC-relative offset of foo
+#------------------------------------------------------------------------------
+ a010: 00005ff0 \.word 0x00005ff0
+ a014: f8df 4000 ldr\.w r4, \[pc\] ; a018 <_start\+0xc>
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f1's .iplt entry
+#------------------------------------------------------------------------------
+ a018: fffff014 \.word 0xfffff014
+ a01c: f8df 4000 ldr\.w r4, \[pc\] ; a020 <_start\+0x14>
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f2's .plt entry
+#------------------------------------------------------------------------------
+ a020: fffff000 \.word 0xfffff000
+ a024: f8df 4000 ldr\.w r4, \[pc\] ; a028 <_start\+0x1c>
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f3
+#------------------------------------------------------------------------------
+ a028: fffff01c \.word 0xfffff01c
+ a02c: f8df 4000 ldr\.w r4, \[pc\] ; a030 <_start\+0x24>
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f1t's .iplt entry
+#------------------------------------------------------------------------------
+ a030: fffff008 \.word 0xfffff008
+ a034: f8df 4000 ldr\.w r4, \[pc\] ; a038 <_start\+0x2c>
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f2t's .plt entry
+#------------------------------------------------------------------------------
+ a038: ffffefdc \.word 0xffffefdc
+ a03c: f8df 4000 ldr\.w r4, \[pc\] ; a040 <_start\+0x34>
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f3t
+#------------------------------------------------------------------------------
+ a040: fffff010 \.word 0xfffff010
diff --git a/ld/testsuite/ld-arm/ifunc-14.gd b/ld/testsuite/ld-arm/ifunc-14.gd
new file mode 100644
index 0000000000..c054e6bb1c
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-14.gd
@@ -0,0 +1,27 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------------------------------------------------------------------------------
+ 10000 44332211 00800000 20800000 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: f2t's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11000 00200100 00000000 00000000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: f2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011014: f1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011018: f1t's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001101c: f3's .igot.plt pointer to 0xa004 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11010 00900000 00a00000 09a00000 04a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011020: f3t's .igot.plt pointer to 0xa00b [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11020 0ba00000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-14.rd b/ld/testsuite/ld-arm/ifunc-14.rd
new file mode 100644
index 0000000000..59ea29bcb2
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-14.rd
@@ -0,0 +1,12 @@
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 4 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+00011014 ......a0 R_ARM_IRELATIVE
+00011018 ......a0 R_ARM_IRELATIVE
+0001101c ......a0 R_ARM_IRELATIVE
+00011020 ......a0 R_ARM_IRELATIVE
+
+Relocation section '\.rel\.plt' at offset 0x8020 contains 2 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......16 R_ARM_JUMP_SLOT 00009014 f2t
+00011010 ......16 R_ARM_JUMP_SLOT 00009020 f2
diff --git a/ld/testsuite/ld-arm/ifunc-14.s b/ld/testsuite/ld-arm/ifunc-14.s
new file mode 100644
index 0000000000..8a166af7e6
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-14.s
@@ -0,0 +1,47 @@
+ .syntax unified
+ .arch armv6t2
+
+ .macro define,name,type
+ .type \name,%gnu_indirect_function
+ \type
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name
+ ldr r4,1f
+1:
+ .word \name - .
+ .endm
+
+ .global f2
+ .global f2t
+
+ .global f3
+ .hidden f3
+ .global f3t
+ .hidden f3t
+
+ define f1,.arm
+ define f3,.arm
+
+ define f1t,.thumb_func
+ define f3t,.thumb_func
+
+ .globl _start
+_start:
+ test_relocs foo
+ test_relocs f1
+ test_relocs f2
+ test_relocs f3
+ test_relocs f1t
+ test_relocs f2t
+ test_relocs f3t
+ .size _start,.-_start
+
+ .data
+foo:
+ .word 0x11223344
+ .word __irel_start
+ .word __irel_end
diff --git a/ld/testsuite/ld-arm/ifunc-15.dd b/ld/testsuite/ld-arm/ifunc-15.dd
new file mode 100644
index 0000000000..886d35512d
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-15.dd
@@ -0,0 +1,100 @@
+
+.*
+
+
+Disassembly of section \.plt:
+
+00009000 <\.plt>:
+ 9000: e52de004 push {lr} ; \(str lr, \[sp, #-4\]!\)
+ 9004: e59fe004 ldr lr, \[pc, #4\] ; 9010 <__irel_end\+0xff0>
+ 9008: e08fe00e add lr, pc, lr
+ 900c: e5bef008 ldr pc, \[lr, #8\]!
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got.plt
+#------------------------------------------------------------------------------
+ 9010: 00007ff0 \.word 0x00007ff0
+#------------------------------------------------------------------------------
+#------ f2t's .plt entry
+#------------------------------------------------------------------------------
+ 9014: e28fc600 add ip, pc, #0
+ 9018: e28cca07 add ip, ip, #28672 ; 0x7000
+ 901c: e5bcfff0 ldr pc, \[ip, #4080\]! ; 0xff0
+#------------------------------------------------------------------------------
+#------ f2's .plt entry
+#------------------------------------------------------------------------------
+ 9020: e28fc600 add ip, pc, #0
+ 9024: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9028: e5bcffe8 ldr pc, \[ip, #4072\]! ; 0xfe8
+
+Disassembly of section \.iplt:
+
+0000902c <f3-0x18>:
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ 902c: e28fc600 add ip, pc, #0
+ 9030: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9034: e5bcffe0 ldr pc, \[ip, #4064\]! ; 0xfe0
+#------------------------------------------------------------------------------
+#------ f1t's .iplt entry
+#------------------------------------------------------------------------------
+ 9038: e28fc600 add ip, pc, #0
+ 903c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9040: e5bcffd8 ldr pc, \[ip, #4056\]! ; 0xfd8
+
+00009044 <f3>:
+ 9044: e28fc600 add ip, pc, #0
+ 9048: e28cca07 add ip, ip, #28672 ; 0x7000
+ 904c: e5bcffd0 ldr pc, \[ip, #4048\]! ; 0xfd0
+
+00009050 <f3t>:
+ 9050: e28fc600 add ip, pc, #0
+ 9054: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9058: e5bcffc8 ldr pc, \[ip, #4040\]! ; 0xfc8
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+ a004: e1a0f00e mov pc, lr
+
+0000a008 <f1t>:
+ a008: 46f7 mov pc, lr
+ a00a: 46f7 mov pc, lr
+
+0000a00c <_start>:
+ a00c: f8df 4000 ldr\.w r4, \[pc\] ; a010 <_start\+0x4>
+#------------------------------------------------------------------------------
+#------ foo
+#------------------------------------------------------------------------------
+ a010: 00010000 \.word 0x00010000
+ a014: f8df 4000 ldr\.w r4, \[pc\] ; a018 <_start\+0xc>
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a018: 0000902c \.word 0x0000902c
+ a01c: f8df 4000 ldr\.w r4, \[pc\] ; a020 <_start\+0x14>
+#------------------------------------------------------------------------------
+#------ f2's .plt entry
+#------------------------------------------------------------------------------
+ a020: 00009020 \.word 0x00009020
+ a024: f8df 4000 ldr\.w r4, \[pc\] ; a028 <_start\+0x1c>
+#------------------------------------------------------------------------------
+#------ f3
+#------------------------------------------------------------------------------
+ a028: 00009044 \.word 0x00009044
+ a02c: f8df 4000 ldr\.w r4, \[pc\] ; a030 <_start\+0x24>
+#------------------------------------------------------------------------------
+#------ f1t's .iplt entry
+#------------------------------------------------------------------------------
+ a030: 00009038 \.word 0x00009038
+ a034: f8df 4000 ldr\.w r4, \[pc\] ; a038 <_start\+0x2c>
+#------------------------------------------------------------------------------
+#------ f2t's .plt entry
+#------------------------------------------------------------------------------
+ a038: 00009014 \.word 0x00009014
+ a03c: f8df 4000 ldr\.w r4, \[pc\] ; a040 <_start\+0x34>
+#------------------------------------------------------------------------------
+#------ f3t
+#------------------------------------------------------------------------------
+ a040: 00009050 \.word 0x00009050
diff --git a/ld/testsuite/ld-arm/ifunc-15.gd b/ld/testsuite/ld-arm/ifunc-15.gd
new file mode 100644
index 0000000000..c054e6bb1c
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-15.gd
@@ -0,0 +1,27 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------------------------------------------------------------------------------
+ 10000 44332211 00800000 20800000 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: f2t's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11000 00200100 00000000 00000000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: f2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011014: f1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011018: f1t's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001101c: f3's .igot.plt pointer to 0xa004 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11010 00900000 00a00000 09a00000 04a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011020: f3t's .igot.plt pointer to 0xa00b [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11020 0ba00000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-15.rd b/ld/testsuite/ld-arm/ifunc-15.rd
new file mode 100644
index 0000000000..59ea29bcb2
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-15.rd
@@ -0,0 +1,12 @@
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 4 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+00011014 ......a0 R_ARM_IRELATIVE
+00011018 ......a0 R_ARM_IRELATIVE
+0001101c ......a0 R_ARM_IRELATIVE
+00011020 ......a0 R_ARM_IRELATIVE
+
+Relocation section '\.rel\.plt' at offset 0x8020 contains 2 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......16 R_ARM_JUMP_SLOT 00009014 f2t
+00011010 ......16 R_ARM_JUMP_SLOT 00009020 f2
diff --git a/ld/testsuite/ld-arm/ifunc-15.s b/ld/testsuite/ld-arm/ifunc-15.s
new file mode 100644
index 0000000000..91cb9972a6
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-15.s
@@ -0,0 +1,47 @@
+ .syntax unified
+ .arch armv6t2
+
+ .macro define,name,type
+ .type \name,%gnu_indirect_function
+ \type
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name
+ ldr r4,1f
+1:
+ .word \name
+ .endm
+
+ .global f2
+ .global f2t
+
+ .global f3
+ .hidden f3
+ .global f3t
+ .hidden f3t
+
+ define f1,.arm
+ define f3,.arm
+
+ define f1t,.thumb_func
+ define f3t,.thumb_func
+
+ .globl _start
+_start:
+ test_relocs foo
+ test_relocs f1
+ test_relocs f2
+ test_relocs f3
+ test_relocs f1t
+ test_relocs f2t
+ test_relocs f3t
+ .size _start,.-_start
+
+ .data
+foo:
+ .word 0x11223344
+ .word __irel_start
+ .word __irel_end
diff --git a/ld/testsuite/ld-arm/ifunc-16.dd b/ld/testsuite/ld-arm/ifunc-16.dd
new file mode 100644
index 0000000000..d3b39bd7a8
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-16.dd
@@ -0,0 +1,88 @@
+
+.*
+
+
+Disassembly of section \.iplt:
+
+00009000 <f2t-0x18>:
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ 9000: e28fc600 add ip, pc, #0
+ 9004: e28cca08 add ip, ip, #32768 ; 0x8000
+ 9008: e5bcf004 ldr pc, \[ip, #4\]!
+#------------------------------------------------------------------------------
+#------ f1t's .iplt entry
+#------------------------------------------------------------------------------
+ 900c: e28fc600 add ip, pc, #0
+ 9010: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9014: e5bcfffc ldr pc, \[ip, #4092\]! ; 0xffc
+
+00009018 <f2t>:
+ 9018: e28fc600 add ip, pc, #0
+ 901c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9020: e5bcfff4 ldr pc, \[ip, #4084\]! ; 0xff4
+
+00009024 <f3>:
+ 9024: e28fc600 add ip, pc, #0
+ 9028: e28cca07 add ip, ip, #28672 ; 0x7000
+ 902c: e5bcffec ldr pc, \[ip, #4076\]! ; 0xfec
+
+00009030 <f2>:
+ 9030: e28fc600 add ip, pc, #0
+ 9034: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9038: e5bcffe4 ldr pc, \[ip, #4068\]! ; 0xfe4
+
+0000903c <f3t>:
+ 903c: e28fc600 add ip, pc, #0
+ 9040: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9044: e5bcffdc ldr pc, \[ip, #4060\]! ; 0xfdc
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+ a004: e1a0f00e mov pc, lr
+ a008: e1a0f00e mov pc, lr
+
+0000a00c <f1t>:
+ a00c: 46f7 mov pc, lr
+ a00e: 46f7 mov pc, lr
+ a010: 46f7 mov pc, lr
+
+0000a012 <_start>:
+ a012: 4c00 ldr r4, \[pc, #0\] ; \(a014 <_start\+0x2>\)
+#------------------------------------------------------------------------------
+#------ foo
+#------------------------------------------------------------------------------
+ a014: 00010000 \.word 0x00010000
+ a018: f8df 4000 ldr\.w r4, \[pc\] ; a01c <_start\+0xa>
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a01c: 00009000 \.word 0x00009000
+ a020: f8df 4000 ldr\.w r4, \[pc\] ; a024 <_start\+0x12>
+#------------------------------------------------------------------------------
+#------ f2
+#------------------------------------------------------------------------------
+ a024: 00009030 \.word 0x00009030
+ a028: f8df 4000 ldr\.w r4, \[pc\] ; a02c <_start\+0x1a>
+#------------------------------------------------------------------------------
+#------ f3
+#------------------------------------------------------------------------------
+ a02c: 00009024 \.word 0x00009024
+ a030: f8df 4000 ldr\.w r4, \[pc\] ; a034 <_start\+0x22>
+#------------------------------------------------------------------------------
+#------ f1t's .iplt entry
+#------------------------------------------------------------------------------
+ a034: 0000900c \.word 0x0000900c
+ a038: f8df 4000 ldr\.w r4, \[pc\] ; a03c <_start\+0x2a>
+#------------------------------------------------------------------------------
+#------ f2t
+#------------------------------------------------------------------------------
+ a03c: 00009018 \.word 0x00009018
+ a040: f8df 4000 ldr\.w r4, \[pc\] ; a044 <_start\+0x32>
+#------------------------------------------------------------------------------
+#------ f3t
+#------------------------------------------------------------------------------
+ a044: 0000903c \.word 0x0000903c
diff --git a/ld/testsuite/ld-arm/ifunc-16.gd b/ld/testsuite/ld-arm/ifunc-16.gd
new file mode 100644
index 0000000000..7c4e82098c
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-16.gd
@@ -0,0 +1,27 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------------------------------------------------------------------------------
+ 10000 44332211 00800000 30800000 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: f1's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11000 00200100 00000000 00000000 00a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: f1t's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011014: f2t's .igot.plt pointer to 0xa00f [R_ARM_IRELATIVE]
+#------ 00011018: f3's .igot.plt pointer to 0xa008 [R_ARM_IRELATIVE]
+#------ 0001101c: f2's .igot.plt pointer to 0xa004 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11010 0da00000 0fa00000 08a00000 04a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011020: f3t's .igot.plt pointer to 0xa011 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11020 11a00000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-16.rd b/ld/testsuite/ld-arm/ifunc-16.rd
new file mode 100644
index 0000000000..7296316488
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-16.rd
@@ -0,0 +1,9 @@
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 6 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......a0 R_ARM_IRELATIVE
+00011010 ......a0 R_ARM_IRELATIVE
+00011014 ......a0 R_ARM_IRELATIVE
+00011018 ......a0 R_ARM_IRELATIVE
+0001101c ......a0 R_ARM_IRELATIVE
+00011020 ......a0 R_ARM_IRELATIVE
diff --git a/ld/testsuite/ld-arm/ifunc-16.s b/ld/testsuite/ld-arm/ifunc-16.s
new file mode 100644
index 0000000000..80fe28261f
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-16.s
@@ -0,0 +1,49 @@
+ .syntax unified
+ .arch armv6t2
+
+ .macro define,name,type
+ .type \name,%gnu_indirect_function
+ \type
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name
+ ldr r4,1f
+1:
+ .word \name
+ .endm
+
+ .global f2
+ .global f2t
+
+ .global f3
+ .hidden f3
+ .global f3t
+ .hidden f3t
+
+ define f1,.arm
+ define f2,.arm
+ define f3,.arm
+
+ define f1t,.thumb_func
+ define f2t,.thumb_func
+ define f3t,.thumb_func
+
+ .globl _start
+_start:
+ test_relocs foo
+ test_relocs f1
+ test_relocs f2
+ test_relocs f3
+ test_relocs f1t
+ test_relocs f2t
+ test_relocs f3t
+ .size _start,.-_start
+
+ .data
+foo:
+ .word 0x11223344
+ .word __irel_start
+ .word __irel_end
diff --git a/ld/testsuite/ld-arm/ifunc-2.dd b/ld/testsuite/ld-arm/ifunc-2.dd
new file mode 100644
index 0000000000..994069ceee
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-2.dd
@@ -0,0 +1,445 @@
+
+.*
+
+
+Disassembly of section \.iplt:
+
+00009000 <f7-0x3c>:
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ 9000: e28fc600 add ip, pc, #0
+ 9004: e28cca08 add ip, ip, #32768 ; 0x8000
+ 9008: e5bcf004 ldr pc, \[ip, #4\]!
+#------------------------------------------------------------------------------
+#------ f2's .iplt entry
+#------------------------------------------------------------------------------
+ 900c: e28fc600 add ip, pc, #0
+ 9010: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9014: e5bcfffc ldr pc, \[ip, #4092\]! ; 0xffc
+#------------------------------------------------------------------------------
+#------ thumb entry to f3's .iplt entry
+#------------------------------------------------------------------------------
+ 9018: 4778 bx pc
+ 901a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ f3's .iplt entry
+#------------------------------------------------------------------------------
+ 901c: e28fc600 add ip, pc, #0
+ 9020: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9024: e5bcfff0 ldr pc, \[ip, #4080\]! ; 0xff0
+#------------------------------------------------------------------------------
+#------ thumb entry to f4's .iplt entry
+#------------------------------------------------------------------------------
+ 9028: 4778 bx pc
+ 902a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ f4's .iplt entry
+#------------------------------------------------------------------------------
+ 902c: e28fc600 add ip, pc, #0
+ 9030: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9034: e5bcffe4 ldr pc, \[ip, #4068\]! ; 0xfe4
+#------------------------------------------------------------------------------
+#------ thumb entry to f7
+#------------------------------------------------------------------------------
+ 9038: 4778 bx pc
+ 903a: 46c0 nop ; \(mov r8, r8\)
+
+0000903c <f7>:
+ 903c: e28fc600 add ip, pc, #0
+ 9040: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9044: e5bcffd8 ldr pc, \[ip, #4056\]! ; 0xfd8
+
+00009048 <f5>:
+ 9048: e28fc600 add ip, pc, #0
+ 904c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9050: e5bcffd0 ldr pc, \[ip, #4048\]! ; 0xfd0
+#------------------------------------------------------------------------------
+#------ thumb entry to f8
+#------------------------------------------------------------------------------
+ 9054: 4778 bx pc
+ 9056: 46c0 nop ; \(mov r8, r8\)
+
+00009058 <f8>:
+ 9058: e28fc600 add ip, pc, #0
+ 905c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9060: e5bcffc4 ldr pc, \[ip, #4036\]! ; 0xfc4
+
+00009064 <f6>:
+ 9064: e28fc600 add ip, pc, #0
+ 9068: e28cca07 add ip, ip, #28672 ; 0x7000
+ 906c: e5bcffbc ldr pc, \[ip, #4028\]! ; 0xfbc
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+
+0000a004 <f2>:
+ a004: 46f7 mov pc, lr
+ \.\.\.
+
+0000a008 <f3>:
+ a008: e1a0f00e mov pc, lr
+
+0000a00c <f4>:
+ a00c: 46f7 mov pc, lr
+ a00e: 0000 movs r0, r0
+ a010: e1a0f00e mov pc, lr
+ a014: 46f7 mov pc, lr
+ a016: 0000 movs r0, r0
+ a018: e1a0f00e mov pc, lr
+ a01c: 46f7 mov pc, lr
+ \.\.\.
+
+0000a020 <_start>:
+ a020: eb0017f6 bl 10000 <foo>
+ a024: ea0017f5 b 10000 <foo>
+ a028: 0a0017f4 beq 10000 <foo>
+ a02c: e59f4014 ldr r4, \[pc, #20\] ; a048 <_start\+0x28>
+ a030: e59f4014 ldr r4, \[pc, #20\] ; a04c <_start\+0x2c>
+ a034: e59f4014 ldr r4, \[pc, #20\] ; a050 <_start\+0x30>
+ a038: e59f4014 ldr r4, \[pc, #20\] ; a054 <_start\+0x34>
+ a03c: e59f5014 ldr r5, \[pc, #20\] ; a058 <_start\+0x38>
+ a040: e3004000 movw r4, #0
+ a044: e3404001 movt r4, #1
+#------------------------------------------------------------------------------
+#------ foo
+#------------------------------------------------------------------------------
+ a048: 00010000 \.word 0x00010000
+#------------------------------------------------------------------------------
+#------ PC-relative offset of foo
+#------------------------------------------------------------------------------
+ a04c: 00005fb4 \.word 0x00005fb4
+#------------------------------------------------------------------------------
+#------ GP-relative offset of foo
+#------------------------------------------------------------------------------
+ a050: fffff000 \.word 0xfffff000
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a054: 00000040 \.word 0x00000040
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a058: 00006fd4 \.word 0x00006fd4
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a05c: ebfffbe7 bl 9000 <f7-0x3c>
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a060: eafffbe6 b 9000 <f7-0x3c>
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a064: 0afffbe5 beq 9000 <f7-0x3c>
+ a068: e59f4014 ldr r4, \[pc, #20\] ; a084 <_start\+0x64>
+ a06c: e59f4014 ldr r4, \[pc, #20\] ; a088 <_start\+0x68>
+ a070: e59f4014 ldr r4, \[pc, #20\] ; a08c <_start\+0x6c>
+ a074: e59f4014 ldr r4, \[pc, #20\] ; a090 <_start\+0x70>
+ a078: e59f5014 ldr r5, \[pc, #20\] ; a094 <_start\+0x74>
+ a07c: e3094000 movw r4, #36864 ; 0x9000
+ a080: e3404000 movt r4, #0
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a084: 00009000 \.word 0x00009000
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f1's .iplt entry
+#------------------------------------------------------------------------------
+ a088: ffffef78 \.word 0xffffef78
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f1's .iplt entry
+#------------------------------------------------------------------------------
+ a08c: ffff8000 \.word 0xffff8000
+#------------------------------------------------------------------------------
+#------ .got offset for f1's .iplt entry
+#------------------------------------------------------------------------------
+ a090: 00000030 \.word 0x00000030
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f1's .iplt entry
+#------------------------------------------------------------------------------
+ a094: 00006f9c \.word 0x00006f9c
+#------------------------------------------------------------------------------
+#------ f2's .iplt entry
+#------------------------------------------------------------------------------
+ a098: ebfffbdb bl 900c <f7-0x30>
+#------------------------------------------------------------------------------
+#------ f2's .iplt entry
+#------------------------------------------------------------------------------
+ a09c: eafffbda b 900c <f7-0x30>
+#------------------------------------------------------------------------------
+#------ f2's .iplt entry
+#------------------------------------------------------------------------------
+ a0a0: 0afffbd9 beq 900c <f7-0x30>
+ a0a4: e59f4014 ldr r4, \[pc, #20\] ; a0c0 <_start\+0xa0>
+ a0a8: e59f4014 ldr r4, \[pc, #20\] ; a0c4 <_start\+0xa4>
+ a0ac: e59f4014 ldr r4, \[pc, #20\] ; a0c8 <_start\+0xa8>
+ a0b0: e59f4014 ldr r4, \[pc, #20\] ; a0cc <_start\+0xac>
+ a0b4: e59f5014 ldr r5, \[pc, #20\] ; a0d0 <_start\+0xb0>
+ a0b8: e309400c movw r4, #36876 ; 0x900c
+ a0bc: e3404000 movt r4, #0
+#------------------------------------------------------------------------------
+#------ f2's .iplt entry
+#------------------------------------------------------------------------------
+ a0c0: 0000900c \.word 0x0000900c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f2's .iplt entry
+#------------------------------------------------------------------------------
+ a0c4: ffffef48 \.word 0xffffef48
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f2's .iplt entry
+#------------------------------------------------------------------------------
+ a0c8: ffff800c \.word 0xffff800c
+#------------------------------------------------------------------------------
+#------ .got offset for f2's .iplt entry
+#------------------------------------------------------------------------------
+ a0cc: 00000034 \.word 0x00000034
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f2's .iplt entry
+#------------------------------------------------------------------------------
+ a0d0: 00006f64 \.word 0x00006f64
+ a0d4: ebfffbdb bl 9048 <f5>
+ a0d8: eafffbda b 9048 <f5>
+ a0dc: 0afffbd9 beq 9048 <f5>
+ a0e0: e59f4014 ldr r4, \[pc, #20\] ; a0fc <_start\+0xdc>
+ a0e4: e59f4014 ldr r4, \[pc, #20\] ; a100 <_start\+0xe0>
+ a0e8: e59f4014 ldr r4, \[pc, #20\] ; a104 <_start\+0xe4>
+ a0ec: e59f4014 ldr r4, \[pc, #20\] ; a108 <_start\+0xe8>
+ a0f0: e59f5014 ldr r5, \[pc, #20\] ; a10c <_start\+0xec>
+ a0f4: e3094048 movw r4, #36936 ; 0x9048
+ a0f8: e3404000 movt r4, #0
+#------------------------------------------------------------------------------
+#------ f5
+#------------------------------------------------------------------------------
+ a0fc: 00009048 \.word 0x00009048
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f5
+#------------------------------------------------------------------------------
+ a100: ffffef48 \.word 0xffffef48
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f5
+#------------------------------------------------------------------------------
+ a104: ffff8048 \.word 0xffff8048
+#------------------------------------------------------------------------------
+#------ .got offset for f5
+#------------------------------------------------------------------------------
+ a108: 00000048 \.word 0x00000048
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f5
+#------------------------------------------------------------------------------
+ a10c: 00006f3c \.word 0x00006f3c
+ a110: ebfffbd3 bl 9064 <f6>
+ a114: eafffbd2 b 9064 <f6>
+ a118: 0afffbd1 beq 9064 <f6>
+ a11c: e59f4014 ldr r4, \[pc, #20\] ; a138 <_start\+0x118>
+ a120: e59f4014 ldr r4, \[pc, #20\] ; a13c <_start\+0x11c>
+ a124: e59f4014 ldr r4, \[pc, #20\] ; a140 <_start\+0x120>
+ a128: e59f4014 ldr r4, \[pc, #20\] ; a144 <_start\+0x124>
+ a12c: e59f5014 ldr r5, \[pc, #20\] ; a148 <_start\+0x128>
+ a130: e3094064 movw r4, #36964 ; 0x9064
+ a134: e3404000 movt r4, #0
+#------------------------------------------------------------------------------
+#------ f6
+#------------------------------------------------------------------------------
+ a138: 00009064 \.word 0x00009064
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f6
+#------------------------------------------------------------------------------
+ a13c: ffffef28 \.word 0xffffef28
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f6
+#------------------------------------------------------------------------------
+ a140: ffff8064 \.word 0xffff8064
+#------------------------------------------------------------------------------
+#------ .got offset for f6
+#------------------------------------------------------------------------------
+ a144: 00000050 \.word 0x00000050
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f6
+#------------------------------------------------------------------------------
+ a148: 00006f08 \.word 0x00006f08
+
+0000a14c <_thumb>:
+ a14c: f005 ff58 bl 10000 <foo>
+ a150: f005 bf56 b\.w 10000 <foo>
+ a154: f005 8754 beq\.w 10000 <foo>
+ a158: 4c04 ldr r4, \[pc, #16\] ; \(a16c <_thumb\+0x20>\)
+ a15a: f8df 4014 ldr\.w r4, \[pc, #20\] ; a170 <_thumb\+0x24>
+ a15e: 4c05 ldr r4, \[pc, #20\] ; \(a174 <_thumb\+0x28>\)
+ a160: 4c05 ldr r4, \[pc, #20\] ; \(a178 <_thumb\+0x2c>\)
+ a162: 4d06 ldr r5, \[pc, #24\] ; \(a17c <_thumb\+0x30>\)
+ a164: f240 0400 movw r4, #0
+ a168: f2c0 0401 movt r4, #1
+#------------------------------------------------------------------------------
+#------ foo
+#------------------------------------------------------------------------------
+ a16c: 00010000 \.word 0x00010000
+#------------------------------------------------------------------------------
+#------ PC-relative offset of foo
+#------------------------------------------------------------------------------
+ a170: 00005e90 \.word 0x00005e90
+#------------------------------------------------------------------------------
+#------ GP-relative offset of foo
+#------------------------------------------------------------------------------
+ a174: fffff000 \.word 0xfffff000
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a178: 00000040 \.word 0x00000040
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a17c: 00006eb0 \.word 0x00006eb0
+#------------------------------------------------------------------------------
+#------ f3's .iplt entry
+#------------------------------------------------------------------------------
+ a180: f7fe ef4c blx 901c <f7-0x20>
+#------------------------------------------------------------------------------
+#------ thumb entry to f3's .iplt entry
+#------------------------------------------------------------------------------
+ a184: f7fe bf48 b\.w 9018 <f7-0x24>
+#------------------------------------------------------------------------------
+#------ thumb entry to f3's .iplt entry
+#------------------------------------------------------------------------------
+ a188: f43e af46 beq\.w 9018 <f7-0x24>
+ a18c: 4c04 ldr r4, \[pc, #16\] ; \(a1a0 <_thumb\+0x54>\)
+ a18e: f8df 4014 ldr\.w r4, \[pc, #20\] ; a1a4 <_thumb\+0x58>
+ a192: 4c05 ldr r4, \[pc, #20\] ; \(a1a8 <_thumb\+0x5c>\)
+ a194: 4c05 ldr r4, \[pc, #20\] ; \(a1ac <_thumb\+0x60>\)
+ a196: 4d06 ldr r5, \[pc, #24\] ; \(a1b0 <_thumb\+0x64>\)
+ a198: f249 041c movw r4, #36892 ; 0x901c
+ a19c: f2c0 0400 movt r4, #0
+#------------------------------------------------------------------------------
+#------ f3's .iplt entry
+#------------------------------------------------------------------------------
+ a1a0: 0000901c \.word 0x0000901c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f3's .iplt entry
+#------------------------------------------------------------------------------
+ a1a4: ffffee78 \.word 0xffffee78
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f3's .iplt entry
+#------------------------------------------------------------------------------
+ a1a8: ffff801c \.word 0xffff801c
+#------------------------------------------------------------------------------
+#------ .got offset for f3's .iplt entry
+#------------------------------------------------------------------------------
+ a1ac: 00000038 \.word 0x00000038
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f3's .iplt entry
+#------------------------------------------------------------------------------
+ a1b0: 00006e88 \.word 0x00006e88
+#------------------------------------------------------------------------------
+#------ f4's .iplt entry
+#------------------------------------------------------------------------------
+ a1b4: f7fe ef3a blx 902c <f7-0x10>
+#------------------------------------------------------------------------------
+#------ thumb entry to f4's .iplt entry
+#------------------------------------------------------------------------------
+ a1b8: f7fe bf36 b\.w 9028 <f7-0x14>
+#------------------------------------------------------------------------------
+#------ thumb entry to f4's .iplt entry
+#------------------------------------------------------------------------------
+ a1bc: f43e af34 beq\.w 9028 <f7-0x14>
+ a1c0: 4c04 ldr r4, \[pc, #16\] ; \(a1d4 <_thumb\+0x88>\)
+ a1c2: f8df 4014 ldr\.w r4, \[pc, #20\] ; a1d8 <_thumb\+0x8c>
+ a1c6: 4c05 ldr r4, \[pc, #20\] ; \(a1dc <_thumb\+0x90>\)
+ a1c8: 4c05 ldr r4, \[pc, #20\] ; \(a1e0 <_thumb\+0x94>\)
+ a1ca: 4d06 ldr r5, \[pc, #24\] ; \(a1e4 <_thumb\+0x98>\)
+ a1cc: f249 042c movw r4, #36908 ; 0x902c
+ a1d0: f2c0 0400 movt r4, #0
+#------------------------------------------------------------------------------
+#------ f4's .iplt entry
+#------------------------------------------------------------------------------
+ a1d4: 0000902c \.word 0x0000902c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f4's .iplt entry
+#------------------------------------------------------------------------------
+ a1d8: ffffee54 \.word 0xffffee54
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f4's .iplt entry
+#------------------------------------------------------------------------------
+ a1dc: ffff802c \.word 0xffff802c
+#------------------------------------------------------------------------------
+#------ .got offset for f4's .iplt entry
+#------------------------------------------------------------------------------
+ a1e0: 0000003c \.word 0x0000003c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f4's .iplt entry
+#------------------------------------------------------------------------------
+ a1e4: 00006e58 \.word 0x00006e58
+ a1e8: f7fe ef28 blx 903c <f7>
+#------------------------------------------------------------------------------
+#------ thumb entry to f7
+#------------------------------------------------------------------------------
+ a1ec: f7fe bf24 b\.w 9038 <f7-0x4>
+#------------------------------------------------------------------------------
+#------ thumb entry to f7
+#------------------------------------------------------------------------------
+ a1f0: f43e af22 beq\.w 9038 <f7-0x4>
+ a1f4: 4c04 ldr r4, \[pc, #16\] ; \(a208 <_thumb\+0xbc>\)
+ a1f6: f8df 4014 ldr\.w r4, \[pc, #20\] ; a20c <_thumb\+0xc0>
+ a1fa: 4c05 ldr r4, \[pc, #20\] ; \(a210 <_thumb\+0xc4>\)
+ a1fc: 4c05 ldr r4, \[pc, #20\] ; \(a214 <_thumb\+0xc8>\)
+ a1fe: 4d06 ldr r5, \[pc, #24\] ; \(a218 <_thumb\+0xcc>\)
+ a200: f249 043c movw r4, #36924 ; 0x903c
+ a204: f2c0 0400 movt r4, #0
+#------------------------------------------------------------------------------
+#------ f7
+#------------------------------------------------------------------------------
+ a208: 0000903c \.word 0x0000903c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f7
+#------------------------------------------------------------------------------
+ a20c: ffffee30 \.word 0xffffee30
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f7
+#------------------------------------------------------------------------------
+ a210: ffff803c \.word 0xffff803c
+#------------------------------------------------------------------------------
+#------ .got offset for f7
+#------------------------------------------------------------------------------
+ a214: 00000044 \.word 0x00000044
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f7
+#------------------------------------------------------------------------------
+ a218: 00006e2c \.word 0x00006e2c
+ a21c: f7fe ef1c blx 9058 <f8>
+#------------------------------------------------------------------------------
+#------ thumb entry to f8
+#------------------------------------------------------------------------------
+ a220: f7fe bf18 b\.w 9054 <f5\+0xc>
+#------------------------------------------------------------------------------
+#------ thumb entry to f8
+#------------------------------------------------------------------------------
+ a224: f43e af16 beq\.w 9054 <f5\+0xc>
+ a228: 4c04 ldr r4, \[pc, #16\] ; \(a23c <_thumb\+0xf0>\)
+ a22a: f8df 4014 ldr\.w r4, \[pc, #20\] ; a240 <_thumb\+0xf4>
+ a22e: 4c05 ldr r4, \[pc, #20\] ; \(a244 <_thumb\+0xf8>\)
+ a230: 4c05 ldr r4, \[pc, #20\] ; \(a248 <_thumb\+0xfc>\)
+ a232: 4d06 ldr r5, \[pc, #24\] ; \(a24c <_thumb\+0x100>\)
+ a234: f249 0458 movw r4, #36952 ; 0x9058
+ a238: f2c0 0400 movt r4, #0
+#------------------------------------------------------------------------------
+#------ f8
+#------------------------------------------------------------------------------
+ a23c: 00009058 \.word 0x00009058
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f8
+#------------------------------------------------------------------------------
+ a240: ffffee18 \.word 0xffffee18
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f8
+#------------------------------------------------------------------------------
+ a244: ffff8058 \.word 0xffff8058
+#------------------------------------------------------------------------------
+#------ .got offset for f8
+#------------------------------------------------------------------------------
+ a248: 0000004c \.word 0x0000004c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f8
+#------------------------------------------------------------------------------
+ a24c: 00006e00 \.word 0x00006e00
diff --git a/ld/testsuite/ld-arm/ifunc-2.gd b/ld/testsuite/ld-arm/ifunc-2.gd
new file mode 100644
index 0000000000..0917a75b0a
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-2.gd
@@ -0,0 +1,48 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------------------------------------------------------------------------------
+ 10000 44332211 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: f1's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11000 00000000 00000000 00000000 00a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: f2's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011014: f3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011018: f4's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001101c: f7's .igot.plt pointer to 0xa018 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11010 05a00000 08a00000 0da00000 18a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011020: f5's .igot.plt pointer to 0xa010 [R_ARM_IRELATIVE]
+#------ 00011024: f8's .igot.plt pointer to 0xa01d [R_ARM_IRELATIVE]
+#------ 00011028: f6's .igot.plt pointer to 0xa015 [R_ARM_IRELATIVE]
+#------ 0001102c: .got entry for foo
+#------------------------------------------------------------------------------
+ 11020 10a00000 1da00000 15a00000 00000100 .*
+#------------------------------------------------------------------------------
+#------ 00011030: .got entry for f1's .iplt entry
+#------ 00011034: .got entry for f2's .iplt entry
+#------ 00011038: .got entry for f3's .iplt entry
+#------ 0001103c: .got entry for f4's .iplt entry
+#------------------------------------------------------------------------------
+ 11030 00900000 0c900000 1c900000 2c900000 .*
+#------------------------------------------------------------------------------
+#------ 00011040: .got entry for foo
+#------ 00011044: .got entry for f7
+#------ 00011048: .got entry for f5
+#------ 0001104c: .got entry for f8
+#------------------------------------------------------------------------------
+ 11040 00000100 3c900000 48900000 58900000 .*
+#------------------------------------------------------------------------------
+#------ 00011050: .got entry for f6
+#------------------------------------------------------------------------------
+ 11050 64900000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-2.rd b/ld/testsuite/ld-arm/ifunc-2.rd
new file mode 100644
index 0000000000..92b000a86f
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-2.rd
@@ -0,0 +1,13 @@
+
+There is no dynamic section in this file\.
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 8 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......a0 R_ARM_IRELATIVE
+00011010 ......a0 R_ARM_IRELATIVE
+00011014 ......a0 R_ARM_IRELATIVE
+00011018 ......a0 R_ARM_IRELATIVE
+0001101c ......a0 R_ARM_IRELATIVE
+00011020 ......a0 R_ARM_IRELATIVE
+00011024 ......a0 R_ARM_IRELATIVE
+00011028 ......a0 R_ARM_IRELATIVE
diff --git a/ld/testsuite/ld-arm/ifunc-2.s b/ld/testsuite/ld-arm/ifunc-2.s
new file mode 100644
index 0000000000..8834fbc0ac
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-2.s
@@ -0,0 +1,74 @@
+ .syntax unified
+ .arch armv6t2
+
+ .macro define,name,type
+ .type \name,%gnu_indirect_function
+ \type
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name,width
+ bl\width \name
+ b\width \name
+ beq\width \name
+ ldr r4,1f
+ ldr r4,2f
+ ldr r4,3f
+ ldr r4,4f
+ ldr r5,5f
+ movw r4,#:lower16:\name
+ movt r4,#:upper16:\name
+1:
+ .word \name
+2:
+ .word \name-.
+3:
+ .word \name(GOTOFF)
+4:
+ .word \name(GOT)
+5:
+ .word \name(GOT_PREL)
+ .endm
+
+ define f1,.arm
+ define f2,.thumb_func
+ define f3,.arm
+ define f4,.thumb_func
+
+ .globl f5
+ .globl f6
+ .globl f7
+ .globl f8
+
+ define f5,.arm
+ define f6,.thumb_func
+ define f7,.arm
+ define f8,.thumb_func
+
+ .globl _start
+ .type _start,%function
+ .arm
+_start:
+ test_relocs foo
+ test_relocs f1,
+ test_relocs f2,
+ test_relocs f5,
+ test_relocs f6,
+ .size _start,.-_start
+
+ .globl _thumb
+ .type _thumb,%function
+ .thumb_func
+_thumb:
+ test_relocs foo
+ test_relocs f3,.w
+ test_relocs f4,.w
+ test_relocs f7,.w
+ test_relocs f8,.w
+ .size _thumb,.-_thumb
+
+ .data
+foo:
+ .word 0x11223344
diff --git a/ld/testsuite/ld-arm/ifunc-3.dd b/ld/testsuite/ld-arm/ifunc-3.dd
new file mode 100644
index 0000000000..1a4f52c470
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-3.dd
@@ -0,0 +1,126 @@
+
+.*
+
+
+Disassembly of section \.plt:
+
+00009000 <\.plt>:
+ 9000: e52de004 push {lr} ; \(str lr, \[sp, #-4\]!\)
+ 9004: e59fe004 ldr lr, \[pc, #4\] ; 9010 <f1-0xff0>
+ 9008: e08fe00e add lr, pc, lr
+ 900c: e5bef008 ldr pc, \[lr, #8\]!
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got.plt
+#------------------------------------------------------------------------------
+ 9010: 00007ff0 \.word 0x00007ff0
+#------------------------------------------------------------------------------
+#------ f2's .plt entry
+#------------------------------------------------------------------------------
+ 9014: e28fc600 add ip, pc, #0
+ 9018: e28cca07 add ip, ip, #28672 ; 0x7000
+ 901c: e5bcfff0 ldr pc, \[ip, #4080\]! ; 0xff0
+
+Disassembly of section \.iplt:
+
+00009020 <\.iplt>:
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ 9020: e28fc600 add ip, pc, #0
+ 9024: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9028: e5bcffe8 ldr pc, \[ip, #4072\]! ; 0xfe8
+#------------------------------------------------------------------------------
+#------ f3's .iplt entry
+#------------------------------------------------------------------------------
+ 902c: e28fc600 add ip, pc, #0
+ 9030: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9034: e5bcffe0 ldr pc, \[ip, #4064\]! ; 0xfe0
+#------------------------------------------------------------------------------
+#------ f4's .iplt entry
+#------------------------------------------------------------------------------
+ 9038: e28fc600 add ip, pc, #0
+ 903c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9040: e5bcffd8 ldr pc, \[ip, #4056\]! ; 0xfd8
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+
+0000a004 <f2>:
+ a004: e1a0f00e mov pc, lr
+
+0000a008 <f3>:
+ a008: e1a0f00e mov pc, lr
+
+0000a00c <f4>:
+ a00c: e1a0f00e mov pc, lr
+
+0000a010 <arm>:
+ a010: eb0017fa bl 10000 <foo>
+ a014: e59f4000 ldr r4, \[pc, #0\] ; a01c <arm\+0xc>
+ a018: e59f4000 ldr r4, \[pc, #0\] ; a020 <arm\+0x10>
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a01c: 00000020 \.word 0x00000020
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a020: 00006ffc \.word 0x00006ffc
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a024: ebfffbfd bl 9020 <f1-0xfe0>
+ a028: e59f4000 ldr r4, \[pc, #0\] ; a030 <arm\+0x20>
+ a02c: e59f4000 ldr r4, \[pc, #0\] ; a034 <arm\+0x24>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a030: 00000010 \.word 0x00000010
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a034: 00006fdc \.word 0x00006fdc
+#------------------------------------------------------------------------------
+#------ f2's .plt entry
+#------------------------------------------------------------------------------
+ a038: ebfffbf5 bl 9014 <f1-0xfec>
+ a03c: e59f4000 ldr r4, \[pc, #0\] ; a044 <arm\+0x34>
+ a040: e59f4000 ldr r4, \[pc, #0\] ; a048 <arm\+0x38>
+#------------------------------------------------------------------------------
+#------ .got offset for f2
+#------------------------------------------------------------------------------
+ a044: 00000024 \.word 0x00000024
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f2
+#------------------------------------------------------------------------------
+ a048: 00006fdc \.word 0x00006fdc
+#------------------------------------------------------------------------------
+#------ f3's .iplt entry
+#------------------------------------------------------------------------------
+ a04c: ebfffbf6 bl 902c <f1-0xfd4>
+ a050: e59f4000 ldr r4, \[pc, #0\] ; a058 <arm\+0x48>
+ a054: e59f4000 ldr r4, \[pc, #0\] ; a05c <arm\+0x4c>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a058: 00000014 \.word 0x00000014
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a05c: 00006fb8 \.word 0x00006fb8
+#------------------------------------------------------------------------------
+#------ f4's .iplt entry
+#------------------------------------------------------------------------------
+ a060: ebfffbf4 bl 9038 <f1-0xfc8>
+ a064: e59f4000 ldr r4, \[pc, #0\] ; a06c <arm\+0x5c>
+ a068: e59f4000 ldr r4, \[pc, #0\] ; a070 <arm\+0x60>
+#------------------------------------------------------------------------------
+#------ .got offset for f4
+#------------------------------------------------------------------------------
+ a06c: 00000028 \.word 0x00000028
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f4
+#------------------------------------------------------------------------------
+ a070: 00006fb8 \.word 0x00006fb8
diff --git a/ld/testsuite/ld-arm/ifunc-3.gd b/ld/testsuite/ld-arm/ifunc-3.gd
new file mode 100644
index 0000000000..db7fd422c8
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-3.gd
@@ -0,0 +1,45 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------ 00010004: contains foo [R_ARM_RELATIVE]
+#------ 00010008: contains PC-relative offset of foo
+#------ 0001000c: contains f1 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10000 44332211 00000100 f8ffffff 00a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010010: contains PC-relative offset of f1's .iplt entry
+#------ 00010014: f2 [R_ARM_ABS32]
+#------ 00010018: f2 [R_ARM_REL32]
+#------ 0001001c: contains f3 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10010 1090ffff 00000000 00000000 08a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010020: contains PC-relative offset of f3's .iplt entry
+#------ 00010024: f4 [R_ARM_ABS32]
+#------ 00010028: contains PC-relative offset of f4's .iplt entry
+#------------------------------------------------------------------------------
+ 10020 0c90ffff 00000000 1090ffff .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: f2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11000 00200100 00000000 00000000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: f1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011014: f3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011018: f4's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001101c: .got entry for foo [R_ARM_RELATIVE]
+#------------------------------------------------------------------------------
+ 11010 00a00000 08a00000 0ca00000 00000100 .*
+#------------------------------------------------------------------------------
+#------ 00011020: .got entry for foo [R_ARM_RELATIVE]
+#------ 00011024: .got entry for f2 [R_ARM_GLOB_DAT]
+#------ 00011028: .got entry for f4 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 11020 00000100 00000000 00000000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-3.rd b/ld/testsuite/ld-arm/ifunc-3.rd
new file mode 100644
index 0000000000..4acb314c04
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-3.rd
@@ -0,0 +1,20 @@
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 13 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+00010004 ......17 R_ARM_RELATIVE
+0001101c ......17 R_ARM_RELATIVE
+00011020 ......17 R_ARM_RELATIVE
+0001000c ......a0 R_ARM_IRELATIVE
+0001001c ......a0 R_ARM_IRELATIVE
+00011010 ......a0 R_ARM_IRELATIVE
+00011014 ......a0 R_ARM_IRELATIVE
+00011018 ......a0 R_ARM_IRELATIVE
+00010014 ......02 R_ARM_ABS32 f2\(\) f2
+00010018 ......03 R_ARM_REL32 f2\(\) f2
+00011024 ......15 R_ARM_GLOB_DAT f2\(\) f2
+00010024 ......02 R_ARM_ABS32 f4\(\) f4
+00011028 ......15 R_ARM_GLOB_DAT f4\(\) f4
+
+Relocation section '\.rel\.plt' at offset 0x8068 contains 1 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......16 R_ARM_JUMP_SLOT f2\(\) f2
diff --git a/ld/testsuite/ld-arm/ifunc-3.s b/ld/testsuite/ld-arm/ifunc-3.s
new file mode 100644
index 0000000000..ace35983af
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-3.s
@@ -0,0 +1,49 @@
+ .macro define,name
+ .text
+ .type \name,%gnu_indirect_function
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name
+ bl \name(PLT)
+ ldr r4,1f
+ ldr r4,2f
+1:
+ .word \name(GOT)
+2:
+ .word \name(GOT_PREL)
+
+ .data
+ .word \name
+ .word \name - .
+ .text
+ .endm
+
+ .globl f2
+
+ .globl f3
+ .hidden f3
+
+ .globl f4
+ .protected f4
+
+ define f1
+ define f2
+ define f3
+ define f4
+
+ .data
+foo:
+ .word 0x11223344
+
+ .text
+ .globl arm
+arm:
+ test_relocs foo
+ test_relocs f1
+ test_relocs f2
+ test_relocs f3
+ test_relocs f4
+ .size arm,.-arm
diff --git a/ld/testsuite/ld-arm/ifunc-4.dd b/ld/testsuite/ld-arm/ifunc-4.dd
new file mode 100644
index 0000000000..f000835d70
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-4.dd
@@ -0,0 +1,1055 @@
+
+.*
+
+
+Disassembly of section \.plt:
+
+00009000 <\.plt>:
+ 9000: e52de004 push {lr} ; \(str lr, \[sp, #-4\]!\)
+ 9004: e59fe004 ldr lr, \[pc, #4\] ; 9010 <aaf1-0xff0>
+ 9008: e08fe00e add lr, pc, lr
+ 900c: e5bef008 ldr pc, \[lr, #8\]!
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got.plt
+#------------------------------------------------------------------------------
+ 9010: 00007ff0 \.word 0x00007ff0
+#------------------------------------------------------------------------------
+#------ thumb entry to atf2's .plt entry
+#------------------------------------------------------------------------------
+ 9014: 4778 bx pc
+ 9016: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ atf2's .plt entry
+#------------------------------------------------------------------------------
+ 9018: e28fc600 add ip, pc, #0
+ 901c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9020: e5bcffec ldr pc, \[ip, #4076\]! ; 0xfec
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf2's .plt entry
+#------------------------------------------------------------------------------
+ 9024: 4778 bx pc
+ 9026: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ ttf2's .plt entry
+#------------------------------------------------------------------------------
+ 9028: e28fc600 add ip, pc, #0
+ 902c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9030: e5bcffe0 ldr pc, \[ip, #4064\]! ; 0xfe0
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf2's .plt entry
+#------------------------------------------------------------------------------
+ 9034: 4778 bx pc
+ 9036: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ 9038: e28fc600 add ip, pc, #0
+ 903c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9040: e5bcffd4 ldr pc, \[ip, #4052\]! ; 0xfd4
+#------------------------------------------------------------------------------
+#------ taf2's .plt entry
+#------------------------------------------------------------------------------
+ 9044: e28fc600 add ip, pc, #0
+ 9048: e28cca07 add ip, ip, #28672 ; 0x7000
+ 904c: e5bcffcc ldr pc, \[ip, #4044\]! ; 0xfcc
+#------------------------------------------------------------------------------
+#------ aaf2's .plt entry
+#------------------------------------------------------------------------------
+ 9050: e28fc600 add ip, pc, #0
+ 9054: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9058: e5bcffc4 ldr pc, \[ip, #4036\]! ; 0xfc4
+#------------------------------------------------------------------------------
+#------ thumb entry to abf2's .plt entry
+#------------------------------------------------------------------------------
+ 905c: 4778 bx pc
+ 905e: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ 9060: e28fc600 add ip, pc, #0
+ 9064: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9068: e5bcffb8 ldr pc, \[ip, #4024\]! ; 0xfb8
+
+Disassembly of section \.iplt:
+
+0000906c <\.iplt>:
+#------------------------------------------------------------------------------
+#------ aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ 906c: e28fc600 add ip, pc, #0
+ 9070: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9074: e5bcffb0 ldr pc, \[ip, #4016\]! ; 0xfb0
+#------------------------------------------------------------------------------
+#------ thumb entry to atf1's .iplt entry
+#------------------------------------------------------------------------------
+ 9078: 4778 bx pc
+ 907a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ atf1's .iplt entry
+#------------------------------------------------------------------------------
+ 907c: e28fc600 add ip, pc, #0
+ 9080: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9084: e5bcffa4 ldr pc, \[ip, #4004\]! ; 0xfa4
+#------------------------------------------------------------------------------
+#------ thumb entry to abf1's .iplt entry
+#------------------------------------------------------------------------------
+ 9088: 4778 bx pc
+ 908a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ 908c: e28fc600 add ip, pc, #0
+ 9090: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9094: e5bcff98 ldr pc, \[ip, #3992\]! ; 0xf98
+#------------------------------------------------------------------------------
+#------ taf1's .iplt entry
+#------------------------------------------------------------------------------
+ 9098: e28fc600 add ip, pc, #0
+ 909c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90a0: e5bcff90 ldr pc, \[ip, #3984\]! ; 0xf90
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90a4: 4778 bx pc
+ 90a6: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90a8: e28fc600 add ip, pc, #0
+ 90ac: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90b0: e5bcff84 ldr pc, \[ip, #3972\]! ; 0xf84
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90b4: 4778 bx pc
+ 90b6: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90b8: e28fc600 add ip, pc, #0
+ 90bc: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90c0: e5bcff78 ldr pc, \[ip, #3960\]! ; 0xf78
+#------------------------------------------------------------------------------
+#------ aaf4's .iplt entry
+#------------------------------------------------------------------------------
+ 90c4: e28fc600 add ip, pc, #0
+ 90c8: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90cc: e5bcff70 ldr pc, \[ip, #3952\]! ; 0xf70
+#------------------------------------------------------------------------------
+#------ thumb entry to atf3's .iplt entry
+#------------------------------------------------------------------------------
+ 90d0: 4778 bx pc
+ 90d2: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ atf3's .iplt entry
+#------------------------------------------------------------------------------
+ 90d4: e28fc600 add ip, pc, #0
+ 90d8: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90dc: e5bcff64 ldr pc, \[ip, #3940\]! ; 0xf64
+#------------------------------------------------------------------------------
+#------ thumb entry to abf3's .iplt entry
+#------------------------------------------------------------------------------
+ 90e0: 4778 bx pc
+ 90e2: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ abf3's .iplt entry
+#------------------------------------------------------------------------------
+ 90e4: e28fc600 add ip, pc, #0
+ 90e8: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90ec: e5bcff58 ldr pc, \[ip, #3928\]! ; 0xf58
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf3's .iplt entry
+#------------------------------------------------------------------------------
+ 90f0: 4778 bx pc
+ 90f2: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ ttf3's .iplt entry
+#------------------------------------------------------------------------------
+ 90f4: e28fc600 add ip, pc, #0
+ 90f8: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90fc: e5bcff4c ldr pc, \[ip, #3916\]! ; 0xf4c
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ 9100: 4778 bx pc
+ 9102: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ 9104: e28fc600 add ip, pc, #0
+ 9108: e28cca07 add ip, ip, #28672 ; 0x7000
+ 910c: e5bcff40 ldr pc, \[ip, #3904\]! ; 0xf40
+#------------------------------------------------------------------------------
+#------ taf3's .iplt entry
+#------------------------------------------------------------------------------
+ 9110: e28fc600 add ip, pc, #0
+ 9114: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9118: e5bcff38 ldr pc, \[ip, #3896\]! ; 0xf38
+#------------------------------------------------------------------------------
+#------ thumb entry to abf4's .iplt entry
+#------------------------------------------------------------------------------
+ 911c: 4778 bx pc
+ 911e: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ abf4's .iplt entry
+#------------------------------------------------------------------------------
+ 9120: e28fc600 add ip, pc, #0
+ 9124: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9128: e5bcff2c ldr pc, \[ip, #3884\]! ; 0xf2c
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf4's .iplt entry
+#------------------------------------------------------------------------------
+ 912c: 4778 bx pc
+ 912e: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ tbf4's .iplt entry
+#------------------------------------------------------------------------------
+ 9130: e28fc600 add ip, pc, #0
+ 9134: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9138: e5bcff20 ldr pc, \[ip, #3872\]! ; 0xf20
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf4's .iplt entry
+#------------------------------------------------------------------------------
+ 913c: 4778 bx pc
+ 913e: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ ttf4's .iplt entry
+#------------------------------------------------------------------------------
+ 9140: e28fc600 add ip, pc, #0
+ 9144: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9148: e5bcff14 ldr pc, \[ip, #3860\]! ; 0xf14
+#------------------------------------------------------------------------------
+#------ aaf3's .iplt entry
+#------------------------------------------------------------------------------
+ 914c: e28fc600 add ip, pc, #0
+ 9150: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9154: e5bcff0c ldr pc, \[ip, #3852\]! ; 0xf0c
+#------------------------------------------------------------------------------
+#------ thumb entry to atf4's .iplt entry
+#------------------------------------------------------------------------------
+ 9158: 4778 bx pc
+ 915a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ atf4's .iplt entry
+#------------------------------------------------------------------------------
+ 915c: e28fc600 add ip, pc, #0
+ 9160: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9164: e5bcff00 ldr pc, \[ip, #3840\]! ; 0xf00
+#------------------------------------------------------------------------------
+#------ taf4's .iplt entry
+#------------------------------------------------------------------------------
+ 9168: e28fc600 add ip, pc, #0
+ 916c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9170: e5bcfef8 ldr pc, \[ip, #3832\]! ; 0xef8
+
+Disassembly of section \.text:
+
+0000a000 <aaf1>:
+ a000: e1a0f00e mov pc, lr
+
+0000a004 <atf1>:
+ a004: e1a0f00e mov pc, lr
+
+0000a008 <abf1>:
+ a008: e1a0f00e mov pc, lr
+
+0000a00c <taf1>:
+ a00c: 46f7 mov pc, lr
+
+0000a00e <ttf1>:
+ a00e: 46f7 mov pc, lr
+
+0000a010 <tbf1>:
+ a010: 46f7 mov pc, lr
+ \.\.\.
+
+0000a014 <aaf2>:
+ a014: e1a0f00e mov pc, lr
+
+0000a018 <atf2>:
+ a018: e1a0f00e mov pc, lr
+
+0000a01c <abf2>:
+ a01c: e1a0f00e mov pc, lr
+
+0000a020 <taf2>:
+ a020: 46f7 mov pc, lr
+
+0000a022 <ttf2>:
+ a022: 46f7 mov pc, lr
+
+0000a024 <tbf2>:
+ a024: 46f7 mov pc, lr
+ \.\.\.
+
+0000a028 <aaf3>:
+ a028: e1a0f00e mov pc, lr
+
+0000a02c <atf3>:
+ a02c: e1a0f00e mov pc, lr
+
+0000a030 <abf3>:
+ a030: e1a0f00e mov pc, lr
+
+0000a034 <taf3>:
+ a034: 46f7 mov pc, lr
+
+0000a036 <ttf3>:
+ a036: 46f7 mov pc, lr
+
+0000a038 <tbf3>:
+ a038: 46f7 mov pc, lr
+ \.\.\.
+
+0000a03c <aaf4>:
+ a03c: e1a0f00e mov pc, lr
+
+0000a040 <atf4>:
+ a040: e1a0f00e mov pc, lr
+
+0000a044 <abf4>:
+ a044: e1a0f00e mov pc, lr
+
+0000a048 <taf4>:
+ a048: 46f7 mov pc, lr
+
+0000a04a <ttf4>:
+ a04a: 46f7 mov pc, lr
+
+0000a04c <tbf4>:
+ a04c: 46f7 mov pc, lr
+ \.\.\.
+
+0000a050 <arm>:
+ a050: eb0017ea bl 10000 <foo>
+ a054: ea0017e9 b 10000 <foo>
+ a058: 0a0017e8 beq 10000 <foo>
+ a05c: e59f4000 ldr r4, \[pc, #0\] ; a064 <arm\+0x14>
+ a060: e59f4000 ldr r4, \[pc, #0\] ; a068 <arm\+0x18>
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a064: 00000070 \.word 0x00000070
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a068: 00007004 \.word 0x00007004
+#------------------------------------------------------------------------------
+#------ aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ a06c: ebfffbfe bl 906c <aaf1-0xf94>
+#------------------------------------------------------------------------------
+#------ aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ a070: eafffbfd b 906c <aaf1-0xf94>
+#------------------------------------------------------------------------------
+#------ aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ a074: 0afffbfc beq 906c <aaf1-0xf94>
+ a078: e59f4000 ldr r4, \[pc, #0\] ; a080 <arm\+0x30>
+ a07c: e59f4000 ldr r4, \[pc, #0\] ; a084 <arm\+0x34>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of aaf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a080: 00000024 \.word 0x00000024
+#------------------------------------------------------------------------------
+#------ PC-relative offset of aaf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a084: 00006fa0 \.word 0x00006fa0
+#------------------------------------------------------------------------------
+#------ taf1's .iplt entry
+#------------------------------------------------------------------------------
+ a088: ebfffc02 bl 9098 <aaf1-0xf68>
+#------------------------------------------------------------------------------
+#------ taf1's .iplt entry
+#------------------------------------------------------------------------------
+ a08c: eafffc01 b 9098 <aaf1-0xf68>
+#------------------------------------------------------------------------------
+#------ taf1's .iplt entry
+#------------------------------------------------------------------------------
+ a090: 0afffc00 beq 9098 <aaf1-0xf68>
+ a094: e59f4000 ldr r4, \[pc, #0\] ; a09c <arm\+0x4c>
+ a098: e59f4000 ldr r4, \[pc, #0\] ; a0a0 <arm\+0x50>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of taf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a09c: 00000030 \.word 0x00000030
+#------------------------------------------------------------------------------
+#------ PC-relative offset of taf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a0a0: 00006f90 \.word 0x00006f90
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a0a4: ebfffbf8 bl 908c <aaf1-0xf74>
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a0a8: eafffbf7 b 908c <aaf1-0xf74>
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a0ac: 0afffbf6 beq 908c <aaf1-0xf74>
+ a0b0: e59f4000 ldr r4, \[pc, #0\] ; a0b8 <arm\+0x68>
+ a0b4: e59f4000 ldr r4, \[pc, #0\] ; a0bc <arm\+0x6c>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of abf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a0b8: 0000002c \.word 0x0000002c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of abf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a0bc: 00006f70 \.word 0x00006f70
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a0c0: ebfffbfc bl 90b8 <aaf1-0xf48>
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a0c4: eafffbfb b 90b8 <aaf1-0xf48>
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a0c8: 0afffbfa beq 90b8 <aaf1-0xf48>
+ a0cc: e59f4000 ldr r4, \[pc, #0\] ; a0d4 <arm\+0x84>
+ a0d0: e59f4000 ldr r4, \[pc, #0\] ; a0d8 <arm\+0x88>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of tbf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a0d4: 00000038 \.word 0x00000038
+#------------------------------------------------------------------------------
+#------ PC-relative offset of tbf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a0d8: 00006f60 \.word 0x00006f60
+#------------------------------------------------------------------------------
+#------ aaf2's .plt entry
+#------------------------------------------------------------------------------
+ a0dc: ebfffbdb bl 9050 <aaf1-0xfb0>
+#------------------------------------------------------------------------------
+#------ aaf2's .plt entry
+#------------------------------------------------------------------------------
+ a0e0: eafffbda b 9050 <aaf1-0xfb0>
+#------------------------------------------------------------------------------
+#------ aaf2's .plt entry
+#------------------------------------------------------------------------------
+ a0e4: 0afffbd9 beq 9050 <aaf1-0xfb0>
+ a0e8: e59f4000 ldr r4, \[pc, #0\] ; a0f0 <arm\+0xa0>
+ a0ec: e59f4000 ldr r4, \[pc, #0\] ; a0f4 <arm\+0xa4>
+#------------------------------------------------------------------------------
+#------ .got offset for aaf2
+#------------------------------------------------------------------------------
+ a0f0: 00000088 \.word 0x00000088
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for aaf2
+#------------------------------------------------------------------------------
+ a0f4: 00006f94 \.word 0x00006f94
+#------------------------------------------------------------------------------
+#------ taf2's .plt entry
+#------------------------------------------------------------------------------
+ a0f8: ebfffbd1 bl 9044 <aaf1-0xfbc>
+#------------------------------------------------------------------------------
+#------ taf2's .plt entry
+#------------------------------------------------------------------------------
+ a0fc: eafffbd0 b 9044 <aaf1-0xfbc>
+#------------------------------------------------------------------------------
+#------ taf2's .plt entry
+#------------------------------------------------------------------------------
+ a100: 0afffbcf beq 9044 <aaf1-0xfbc>
+ a104: e59f4000 ldr r4, \[pc, #0\] ; a10c <arm\+0xbc>
+ a108: e59f4000 ldr r4, \[pc, #0\] ; a110 <arm\+0xc0>
+#------------------------------------------------------------------------------
+#------ .got offset for taf2
+#------------------------------------------------------------------------------
+ a10c: 00000084 \.word 0x00000084
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for taf2
+#------------------------------------------------------------------------------
+ a110: 00006f74 \.word 0x00006f74
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ a114: ebfffbd1 bl 9060 <aaf1-0xfa0>
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ a118: eafffbd0 b 9060 <aaf1-0xfa0>
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ a11c: 0afffbcf beq 9060 <aaf1-0xfa0>
+ a120: e59f4000 ldr r4, \[pc, #0\] ; a128 <arm\+0xd8>
+ a124: e59f4000 ldr r4, \[pc, #0\] ; a12c <arm\+0xdc>
+#------------------------------------------------------------------------------
+#------ .got offset for abf2
+#------------------------------------------------------------------------------
+ a128: 000000a0 \.word 0x000000a0
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf2
+#------------------------------------------------------------------------------
+ a12c: 00006f74 \.word 0x00006f74
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a130: ebfffbc0 bl 9038 <aaf1-0xfc8>
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a134: eafffbbf b 9038 <aaf1-0xfc8>
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a138: 0afffbbe beq 9038 <aaf1-0xfc8>
+ a13c: e59f4000 ldr r4, \[pc, #0\] ; a144 <arm\+0xf4>
+ a140: e59f4000 ldr r4, \[pc, #0\] ; a148 <arm\+0xf8>
+#------------------------------------------------------------------------------
+#------ .got offset for tbf2
+#------------------------------------------------------------------------------
+ a144: 00000080 \.word 0x00000080
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf2
+#------------------------------------------------------------------------------
+ a148: 00006f38 \.word 0x00006f38
+#------------------------------------------------------------------------------
+#------ aaf3's .iplt entry
+#------------------------------------------------------------------------------
+ a14c: ebfffbfe bl 914c <aaf1-0xeb4>
+#------------------------------------------------------------------------------
+#------ aaf3's .iplt entry
+#------------------------------------------------------------------------------
+ a150: eafffbfd b 914c <aaf1-0xeb4>
+#------------------------------------------------------------------------------
+#------ aaf3's .iplt entry
+#------------------------------------------------------------------------------
+ a154: 0afffbfc beq 914c <aaf1-0xeb4>
+ a158: e59f4000 ldr r4, \[pc, #0\] ; a160 <arm\+0x110>
+ a15c: e59f4000 ldr r4, \[pc, #0\] ; a164 <arm\+0x114>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of aaf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a160: 00000060 \.word 0x00000060
+#------------------------------------------------------------------------------
+#------ PC-relative offset of aaf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a164: 00006efc \.word 0x00006efc
+#------------------------------------------------------------------------------
+#------ taf3's .iplt entry
+#------------------------------------------------------------------------------
+ a168: ebfffbe8 bl 9110 <aaf1-0xef0>
+#------------------------------------------------------------------------------
+#------ taf3's .iplt entry
+#------------------------------------------------------------------------------
+ a16c: eafffbe7 b 9110 <aaf1-0xef0>
+#------------------------------------------------------------------------------
+#------ taf3's .iplt entry
+#------------------------------------------------------------------------------
+ a170: 0afffbe6 beq 9110 <aaf1-0xef0>
+ a174: e59f4000 ldr r4, \[pc, #0\] ; a17c <arm\+0x12c>
+ a178: e59f4000 ldr r4, \[pc, #0\] ; a180 <arm\+0x130>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of taf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a17c: 00000050 \.word 0x00000050
+#------------------------------------------------------------------------------
+#------ PC-relative offset of taf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a180: 00006ed0 \.word 0x00006ed0
+#------------------------------------------------------------------------------
+#------ abf3's .iplt entry
+#------------------------------------------------------------------------------
+ a184: ebfffbd6 bl 90e4 <aaf1-0xf1c>
+#------------------------------------------------------------------------------
+#------ abf3's .iplt entry
+#------------------------------------------------------------------------------
+ a188: eafffbd5 b 90e4 <aaf1-0xf1c>
+#------------------------------------------------------------------------------
+#------ abf3's .iplt entry
+#------------------------------------------------------------------------------
+ a18c: 0afffbd4 beq 90e4 <aaf1-0xf1c>
+ a190: e59f4000 ldr r4, \[pc, #0\] ; a198 <arm\+0x148>
+ a194: e59f4000 ldr r4, \[pc, #0\] ; a19c <arm\+0x14c>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of abf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a198: 00000044 \.word 0x00000044
+#------------------------------------------------------------------------------
+#------ PC-relative offset of abf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a19c: 00006ea8 \.word 0x00006ea8
+#------------------------------------------------------------------------------
+#------ tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ a1a0: ebfffbd7 bl 9104 <aaf1-0xefc>
+#------------------------------------------------------------------------------
+#------ tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ a1a4: eafffbd6 b 9104 <aaf1-0xefc>
+#------------------------------------------------------------------------------
+#------ tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ a1a8: 0afffbd5 beq 9104 <aaf1-0xefc>
+ a1ac: e59f4000 ldr r4, \[pc, #0\] ; a1b4 <arm\+0x164>
+ a1b0: e59f4000 ldr r4, \[pc, #0\] ; a1b8 <arm\+0x168>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of tbf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a1b4: 0000004c \.word 0x0000004c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of tbf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a1b8: 00006e94 \.word 0x00006e94
+#------------------------------------------------------------------------------
+#------ aaf4's .iplt entry
+#------------------------------------------------------------------------------
+ a1bc: ebfffbc0 bl 90c4 <aaf1-0xf3c>
+#------------------------------------------------------------------------------
+#------ aaf4's .iplt entry
+#------------------------------------------------------------------------------
+ a1c0: eafffbbf b 90c4 <aaf1-0xf3c>
+#------------------------------------------------------------------------------
+#------ aaf4's .iplt entry
+#------------------------------------------------------------------------------
+ a1c4: 0afffbbe beq 90c4 <aaf1-0xf3c>
+ a1c8: e59f4000 ldr r4, \[pc, #0\] ; a1d0 <arm\+0x180>
+ a1cc: e59f4000 ldr r4, \[pc, #0\] ; a1d4 <arm\+0x184>
+#------------------------------------------------------------------------------
+#------ .got offset for aaf4
+#------------------------------------------------------------------------------
+ a1d0: 00000078 \.word 0x00000078
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for aaf4
+#------------------------------------------------------------------------------
+ a1d4: 00006ea4 \.word 0x00006ea4
+#------------------------------------------------------------------------------
+#------ taf4's .iplt entry
+#------------------------------------------------------------------------------
+ a1d8: ebfffbe2 bl 9168 <aaf1-0xe98>
+#------------------------------------------------------------------------------
+#------ taf4's .iplt entry
+#------------------------------------------------------------------------------
+ a1dc: eafffbe1 b 9168 <aaf1-0xe98>
+#------------------------------------------------------------------------------
+#------ taf4's .iplt entry
+#------------------------------------------------------------------------------
+ a1e0: 0afffbe0 beq 9168 <aaf1-0xe98>
+ a1e4: e59f4000 ldr r4, \[pc, #0\] ; a1ec <arm\+0x19c>
+ a1e8: e59f4000 ldr r4, \[pc, #0\] ; a1f0 <arm\+0x1a0>
+#------------------------------------------------------------------------------
+#------ .got offset for taf4
+#------------------------------------------------------------------------------
+ a1ec: 0000009c \.word 0x0000009c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for taf4
+#------------------------------------------------------------------------------
+ a1f0: 00006eac \.word 0x00006eac
+#------------------------------------------------------------------------------
+#------ abf4's .iplt entry
+#------------------------------------------------------------------------------
+ a1f4: ebfffbc9 bl 9120 <aaf1-0xee0>
+#------------------------------------------------------------------------------
+#------ abf4's .iplt entry
+#------------------------------------------------------------------------------
+ a1f8: eafffbc8 b 9120 <aaf1-0xee0>
+#------------------------------------------------------------------------------
+#------ abf4's .iplt entry
+#------------------------------------------------------------------------------
+ a1fc: 0afffbc7 beq 9120 <aaf1-0xee0>
+ a200: e59f4000 ldr r4, \[pc, #0\] ; a208 <arm\+0x1b8>
+ a204: e59f4000 ldr r4, \[pc, #0\] ; a20c <arm\+0x1bc>
+#------------------------------------------------------------------------------
+#------ .got offset for abf4
+#------------------------------------------------------------------------------
+ a208: 0000008c \.word 0x0000008c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf4
+#------------------------------------------------------------------------------
+ a20c: 00006e80 \.word 0x00006e80
+#------------------------------------------------------------------------------
+#------ tbf4's .iplt entry
+#------------------------------------------------------------------------------
+ a210: ebfffbc6 bl 9130 <aaf1-0xed0>
+#------------------------------------------------------------------------------
+#------ tbf4's .iplt entry
+#------------------------------------------------------------------------------
+ a214: eafffbc5 b 9130 <aaf1-0xed0>
+#------------------------------------------------------------------------------
+#------ tbf4's .iplt entry
+#------------------------------------------------------------------------------
+ a218: 0afffbc4 beq 9130 <aaf1-0xed0>
+ a21c: e59f4000 ldr r4, \[pc, #0\] ; a224 <arm\+0x1d4>
+ a220: e59f4000 ldr r4, \[pc, #0\] ; a228 <arm\+0x1d8>
+#------------------------------------------------------------------------------
+#------ .got offset for tbf4
+#------------------------------------------------------------------------------
+ a224: 00000090 \.word 0x00000090
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf4
+#------------------------------------------------------------------------------
+ a228: 00006e68 \.word 0x00006e68
+
+0000a22c <_thumb>:
+ a22c: f005 fee8 bl 10000 <foo>
+ a230: f005 bee6 b\.w 10000 <foo>
+ a234: f005 86e4 beq\.w 10000 <foo>
+ a238: 4c00 ldr r4, \[pc, #0\] ; \(a23c <_thumb\+0x10>\)
+ a23a: 4c01 ldr r4, \[pc, #4\] ; \(a240 <_thumb\+0x14>\)
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a23c: 00000070 \.word 0x00000070
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a240: 00006e2c \.word 0x00006e2c
+#------------------------------------------------------------------------------
+#------ atf1's .iplt entry
+#------------------------------------------------------------------------------
+ a244: f7fe ef1a blx 907c <aaf1-0xf84>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf1's .iplt entry
+#------------------------------------------------------------------------------
+ a248: f7fe bf16 b\.w 9078 <aaf1-0xf88>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf1's .iplt entry
+#------------------------------------------------------------------------------
+ a24c: f43e af14 beq\.w 9078 <aaf1-0xf88>
+ a250: 4c00 ldr r4, \[pc, #0\] ; \(a254 <_thumb\+0x28>\)
+ a252: 4c01 ldr r4, \[pc, #4\] ; \(a258 <_thumb\+0x2c>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of atf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a254: 00000028 \.word 0x00000028
+#------------------------------------------------------------------------------
+#------ PC-relative offset of atf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a258: 00006dd0 \.word 0x00006dd0
+#------------------------------------------------------------------------------
+#------ ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ a25c: f7fe ef24 blx 90a8 <aaf1-0xf58>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ a260: f7fe bf20 b\.w 90a4 <aaf1-0xf5c>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ a264: f43e af1e beq\.w 90a4 <aaf1-0xf5c>
+ a268: 4c00 ldr r4, \[pc, #0\] ; \(a26c <_thumb\+0x40>\)
+ a26a: 4c01 ldr r4, \[pc, #4\] ; \(a270 <_thumb\+0x44>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of ttf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a26c: 00000034 \.word 0x00000034
+#------------------------------------------------------------------------------
+#------ PC-relative offset of ttf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a270: 00006dc4 \.word 0x00006dc4
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a274: f7fe ef0a blx 908c <aaf1-0xf74>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a278: f7fe bf06 b\.w 9088 <aaf1-0xf78>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a27c: f43e af04 beq\.w 9088 <aaf1-0xf78>
+ a280: 4c00 ldr r4, \[pc, #0\] ; \(a284 <_thumb\+0x58>\)
+ a282: 4c01 ldr r4, \[pc, #4\] ; \(a288 <_thumb\+0x5c>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of abf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a284: 0000002c \.word 0x0000002c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of abf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a288: 00006da4 \.word 0x00006da4
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a28c: f7fe ef14 blx 90b8 <aaf1-0xf48>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a290: f7fe bf10 b\.w 90b4 <aaf1-0xf4c>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a294: f43e af0e beq\.w 90b4 <aaf1-0xf4c>
+ a298: 4c00 ldr r4, \[pc, #0\] ; \(a29c <_thumb\+0x70>\)
+ a29a: 4c01 ldr r4, \[pc, #4\] ; \(a2a0 <_thumb\+0x74>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of tbf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a29c: 00000038 \.word 0x00000038
+#------------------------------------------------------------------------------
+#------ PC-relative offset of tbf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a2a0: 00006d98 \.word 0x00006d98
+#------------------------------------------------------------------------------
+#------ atf2's .plt entry
+#------------------------------------------------------------------------------
+ a2a4: f7fe eeb8 blx 9018 <aaf1-0xfe8>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf2's .plt entry
+#------------------------------------------------------------------------------
+ a2a8: f7fe beb4 b\.w 9014 <aaf1-0xfec>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf2's .plt entry
+#------------------------------------------------------------------------------
+ a2ac: f43e aeb2 beq\.w 9014 <aaf1-0xfec>
+ a2b0: 4c00 ldr r4, \[pc, #0\] ; \(a2b4 <_thumb\+0x88>\)
+ a2b2: 4c01 ldr r4, \[pc, #4\] ; \(a2b8 <_thumb\+0x8c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for atf2
+#------------------------------------------------------------------------------
+ a2b4: 00000074 \.word 0x00000074
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for atf2
+#------------------------------------------------------------------------------
+ a2b8: 00006dbc \.word 0x00006dbc
+#------------------------------------------------------------------------------
+#------ ttf2's .plt entry
+#------------------------------------------------------------------------------
+ a2bc: f7fe eeb4 blx 9028 <aaf1-0xfd8>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf2's .plt entry
+#------------------------------------------------------------------------------
+ a2c0: f7fe beb0 b\.w 9024 <aaf1-0xfdc>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf2's .plt entry
+#------------------------------------------------------------------------------
+ a2c4: f43e aeae beq\.w 9024 <aaf1-0xfdc>
+ a2c8: 4c00 ldr r4, \[pc, #0\] ; \(a2cc <_thumb\+0xa0>\)
+ a2ca: 4c01 ldr r4, \[pc, #4\] ; \(a2d0 <_thumb\+0xa4>\)
+#------------------------------------------------------------------------------
+#------ .got offset for ttf2
+#------------------------------------------------------------------------------
+ a2cc: 0000007c \.word 0x0000007c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for ttf2
+#------------------------------------------------------------------------------
+ a2d0: 00006dac \.word 0x00006dac
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ a2d4: f7fe eec4 blx 9060 <aaf1-0xfa0>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf2's .plt entry
+#------------------------------------------------------------------------------
+ a2d8: f7fe bec0 b\.w 905c <aaf1-0xfa4>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf2's .plt entry
+#------------------------------------------------------------------------------
+ a2dc: f43e aebe beq\.w 905c <aaf1-0xfa4>
+ a2e0: 4c00 ldr r4, \[pc, #0\] ; \(a2e4 <_thumb\+0xb8>\)
+ a2e2: 4c01 ldr r4, \[pc, #4\] ; \(a2e8 <_thumb\+0xbc>\)
+#------------------------------------------------------------------------------
+#------ .got offset for abf2
+#------------------------------------------------------------------------------
+ a2e4: 000000a0 \.word 0x000000a0
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf2
+#------------------------------------------------------------------------------
+ a2e8: 00006db8 \.word 0x00006db8
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a2ec: f7fe eea4 blx 9038 <aaf1-0xfc8>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a2f0: f7fe bea0 b\.w 9034 <aaf1-0xfcc>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a2f4: f43e ae9e beq\.w 9034 <aaf1-0xfcc>
+ a2f8: 4c00 ldr r4, \[pc, #0\] ; \(a2fc <_thumb\+0xd0>\)
+ a2fa: 4c01 ldr r4, \[pc, #4\] ; \(a300 <_thumb\+0xd4>\)
+#------------------------------------------------------------------------------
+#------ .got offset for tbf2
+#------------------------------------------------------------------------------
+ a2fc: 00000080 \.word 0x00000080
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf2
+#------------------------------------------------------------------------------
+ a300: 00006d80 \.word 0x00006d80
+#------------------------------------------------------------------------------
+#------ atf3's .iplt entry
+#------------------------------------------------------------------------------
+ a304: f7fe eee6 blx 90d4 <aaf1-0xf2c>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf3's .iplt entry
+#------------------------------------------------------------------------------
+ a308: f7fe bee2 b\.w 90d0 <aaf1-0xf30>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf3's .iplt entry
+#------------------------------------------------------------------------------
+ a30c: f43e aee0 beq\.w 90d0 <aaf1-0xf30>
+ a310: 4c00 ldr r4, \[pc, #0\] ; \(a314 <_thumb\+0xe8>\)
+ a312: 4c01 ldr r4, \[pc, #4\] ; \(a318 <_thumb\+0xec>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of atf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a314: 00000040 \.word 0x00000040
+#------------------------------------------------------------------------------
+#------ PC-relative offset of atf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a318: 00006d28 \.word 0x00006d28
+#------------------------------------------------------------------------------
+#------ ttf3's .iplt entry
+#------------------------------------------------------------------------------
+ a31c: f7fe eeea blx 90f4 <aaf1-0xf0c>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf3's .iplt entry
+#------------------------------------------------------------------------------
+ a320: f7fe bee6 b\.w 90f0 <aaf1-0xf10>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf3's .iplt entry
+#------------------------------------------------------------------------------
+ a324: f43e aee4 beq\.w 90f0 <aaf1-0xf10>
+ a328: 4c00 ldr r4, \[pc, #0\] ; \(a32c <_thumb\+0x100>\)
+ a32a: 4c01 ldr r4, \[pc, #4\] ; \(a330 <_thumb\+0x104>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of ttf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a32c: 00000048 \.word 0x00000048
+#------------------------------------------------------------------------------
+#------ PC-relative offset of ttf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a330: 00006d18 \.word 0x00006d18
+#------------------------------------------------------------------------------
+#------ abf3's .iplt entry
+#------------------------------------------------------------------------------
+ a334: f7fe eed6 blx 90e4 <aaf1-0xf1c>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf3's .iplt entry
+#------------------------------------------------------------------------------
+ a338: f7fe bed2 b\.w 90e0 <aaf1-0xf20>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf3's .iplt entry
+#------------------------------------------------------------------------------
+ a33c: f43e aed0 beq\.w 90e0 <aaf1-0xf20>
+ a340: 4c00 ldr r4, \[pc, #0\] ; \(a344 <_thumb\+0x118>\)
+ a342: 4c01 ldr r4, \[pc, #4\] ; \(a348 <_thumb\+0x11c>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of abf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a344: 00000044 \.word 0x00000044
+#------------------------------------------------------------------------------
+#------ PC-relative offset of abf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a348: 00006cfc \.word 0x00006cfc
+#------------------------------------------------------------------------------
+#------ tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ a34c: f7fe eeda blx 9104 <aaf1-0xefc>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ a350: f7fe bed6 b\.w 9100 <aaf1-0xf00>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ a354: f43e aed4 beq\.w 9100 <aaf1-0xf00>
+ a358: 4c00 ldr r4, \[pc, #0\] ; \(a35c <_thumb\+0x130>\)
+ a35a: 4c01 ldr r4, \[pc, #4\] ; \(a360 <_thumb\+0x134>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of tbf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a35c: 0000004c \.word 0x0000004c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of tbf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a360: 00006cec \.word 0x00006cec
+#------------------------------------------------------------------------------
+#------ atf4's .iplt entry
+#------------------------------------------------------------------------------
+ a364: f7fe eefa blx 915c <aaf1-0xea4>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf4's .iplt entry
+#------------------------------------------------------------------------------
+ a368: f7fe bef6 b\.w 9158 <aaf1-0xea8>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf4's .iplt entry
+#------------------------------------------------------------------------------
+ a36c: f43e aef4 beq\.w 9158 <aaf1-0xea8>
+ a370: 4c00 ldr r4, \[pc, #0\] ; \(a374 <_thumb\+0x148>\)
+ a372: 4c01 ldr r4, \[pc, #4\] ; \(a378 <_thumb\+0x14c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for atf4
+#------------------------------------------------------------------------------
+ a374: 00000098 \.word 0x00000098
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for atf4
+#------------------------------------------------------------------------------
+ a378: 00006d20 \.word 0x00006d20
+#------------------------------------------------------------------------------
+#------ ttf4's .iplt entry
+#------------------------------------------------------------------------------
+ a37c: f7fe eee0 blx 9140 <aaf1-0xec0>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf4's .iplt entry
+#------------------------------------------------------------------------------
+ a380: f7fe bedc b\.w 913c <aaf1-0xec4>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf4's .iplt entry
+#------------------------------------------------------------------------------
+ a384: f43e aeda beq\.w 913c <aaf1-0xec4>
+ a388: 4c00 ldr r4, \[pc, #0\] ; \(a38c <_thumb\+0x160>\)
+ a38a: 4c01 ldr r4, \[pc, #4\] ; \(a390 <_thumb\+0x164>\)
+#------------------------------------------------------------------------------
+#------ .got offset for ttf4
+#------------------------------------------------------------------------------
+ a38c: 00000094 \.word 0x00000094
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for ttf4
+#------------------------------------------------------------------------------
+ a390: 00006d04 \.word 0x00006d04
+#------------------------------------------------------------------------------
+#------ abf4's .iplt entry
+#------------------------------------------------------------------------------
+ a394: f7fe eec4 blx 9120 <aaf1-0xee0>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf4's .iplt entry
+#------------------------------------------------------------------------------
+ a398: f7fe bec0 b\.w 911c <aaf1-0xee4>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf4's .iplt entry
+#------------------------------------------------------------------------------
+ a39c: f43e aebe beq\.w 911c <aaf1-0xee4>
+ a3a0: 4c00 ldr r4, \[pc, #0\] ; \(a3a4 <_thumb\+0x178>\)
+ a3a2: 4c01 ldr r4, \[pc, #4\] ; \(a3a8 <_thumb\+0x17c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for abf4
+#------------------------------------------------------------------------------
+ a3a4: 0000008c \.word 0x0000008c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf4
+#------------------------------------------------------------------------------
+ a3a8: 00006ce4 \.word 0x00006ce4
+#------------------------------------------------------------------------------
+#------ tbf4's .iplt entry
+#------------------------------------------------------------------------------
+ a3ac: f7fe eec0 blx 9130 <aaf1-0xed0>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf4's .iplt entry
+#------------------------------------------------------------------------------
+ a3b0: f7fe bebc b\.w 912c <aaf1-0xed4>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf4's .iplt entry
+#------------------------------------------------------------------------------
+ a3b4: f43e aeba beq\.w 912c <aaf1-0xed4>
+ a3b8: 4c00 ldr r4, \[pc, #0\] ; \(a3bc <_thumb\+0x190>\)
+ a3ba: 4c01 ldr r4, \[pc, #4\] ; \(a3c0 <_thumb\+0x194>\)
+#------------------------------------------------------------------------------
+#------ .got offset for tbf4
+#------------------------------------------------------------------------------
+ a3bc: 00000090 \.word 0x00000090
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf4
+#------------------------------------------------------------------------------
+ a3c0: 00006cd0 \.word 0x00006cd0
diff --git a/ld/testsuite/ld-arm/ifunc-4.gd b/ld/testsuite/ld-arm/ifunc-4.gd
new file mode 100644
index 0000000000..f768c68743
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-4.gd
@@ -0,0 +1,167 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------ 00010004: contains aaf1 [R_ARM_IRELATIVE]
+#------ 00010008: contains PC-relative offset of aaf1's .iplt entry
+#------ 0001000c: contains atf1 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10000 44332211 00a00000 6490ffff 04a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010010: contains PC-relative offset of atf1's .iplt entry
+#------ 00010014: contains abf1 [R_ARM_IRELATIVE]
+#------ 00010018: contains PC-relative offset of abf1's .iplt entry
+#------ 0001001c: contains taf1 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10010 6c90ffff 08a00000 7490ffff 0da00000 .*
+#------------------------------------------------------------------------------
+#------ 00010020: contains PC-relative offset of taf1's .iplt entry
+#------ 00010024: contains ttf1 [R_ARM_IRELATIVE]
+#------ 00010028: contains PC-relative offset of ttf1's .iplt entry
+#------ 0001002c: contains tbf1 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10020 7890ffff 0fa00000 8090ffff 11a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010030: contains PC-relative offset of tbf1's .iplt entry
+#------ 00010034: aaf2 [R_ARM_ABS32]
+#------ 00010038: aaf2 [R_ARM_REL32]
+#------ 0001003c: atf2 [R_ARM_ABS32]
+#------------------------------------------------------------------------------
+ 10030 8890ffff 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00010040: atf2 [R_ARM_REL32]
+#------ 00010044: abf2 [R_ARM_ABS32]
+#------ 00010048: abf2 [R_ARM_REL32]
+#------ 0001004c: taf2 [R_ARM_ABS32]
+#------------------------------------------------------------------------------
+ 10040 00000000 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00010050: taf2 [R_ARM_REL32]
+#------ 00010054: ttf2 [R_ARM_ABS32]
+#------ 00010058: ttf2 [R_ARM_REL32]
+#------ 0001005c: tbf2 [R_ARM_ABS32]
+#------------------------------------------------------------------------------
+ 10050 00000000 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00010060: tbf2 [R_ARM_REL32]
+#------ 00010064: contains aaf3 [R_ARM_IRELATIVE]
+#------ 00010068: contains PC-relative offset of aaf3's .iplt entry
+#------ 0001006c: contains atf3 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10060 00000000 28a00000 e490ffff 2ca00000 .*
+#------------------------------------------------------------------------------
+#------ 00010070: contains PC-relative offset of atf3's .iplt entry
+#------ 00010074: contains abf3 [R_ARM_IRELATIVE]
+#------ 00010078: contains PC-relative offset of abf3's .iplt entry
+#------ 0001007c: contains taf3 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10070 6490ffff 30a00000 6c90ffff 35a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010080: contains PC-relative offset of taf3's .iplt entry
+#------ 00010084: contains ttf3 [R_ARM_IRELATIVE]
+#------ 00010088: contains PC-relative offset of ttf3's .iplt entry
+#------ 0001008c: contains tbf3 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10080 9090ffff 37a00000 6c90ffff 39a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010090: contains PC-relative offset of tbf3's .iplt entry
+#------ 00010094: aaf4 [R_ARM_ABS32]
+#------ 00010098: contains PC-relative offset of aaf4's .iplt entry
+#------ 0001009c: atf4 [R_ARM_ABS32]
+#------------------------------------------------------------------------------
+ 10090 7490ffff 00000000 2c90ffff 00000000 .*
+#------------------------------------------------------------------------------
+#------ 000100a0: contains PC-relative offset of atf4's .iplt entry
+#------ 000100a4: abf4 [R_ARM_ABS32]
+#------ 000100a8: contains PC-relative offset of abf4's .iplt entry
+#------ 000100ac: taf4 [R_ARM_ABS32]
+#------------------------------------------------------------------------------
+ 100a0 bc90ffff 00000000 7890ffff 00000000 .*
+#------------------------------------------------------------------------------
+#------ 000100b0: contains PC-relative offset of taf4's .iplt entry
+#------ 000100b4: ttf4 [R_ARM_ABS32]
+#------ 000100b8: contains PC-relative offset of ttf4's .iplt entry
+#------ 000100bc: tbf4 [R_ARM_ABS32]
+#------------------------------------------------------------------------------
+ 100b0 b890ffff 00000000 8890ffff 00000000 .*
+#------------------------------------------------------------------------------
+#------ 000100c0: contains PC-relative offset of tbf4's .iplt entry
+#------------------------------------------------------------------------------
+ 100c0 7090ffff .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: atf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11000 00200100 00000000 00000000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: ttf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011014: tbf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011018: taf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 0001101c: aaf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11010 00900000 00900000 00900000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011020: abf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011024: aaf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011028: atf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001102c: abf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11020 00900000 00a00000 04a00000 08a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011030: taf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011034: ttf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011038: tbf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001103c: aaf4's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11030 0da00000 0fa00000 11a00000 3ca00000 .*
+#------------------------------------------------------------------------------
+#------ 00011040: atf3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011044: abf3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011048: ttf3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001104c: tbf3's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11040 2ca00000 30a00000 37a00000 39a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011050: taf3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011054: abf4's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011058: tbf4's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001105c: ttf4's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11050 35a00000 44a00000 4da00000 4ba00000 .*
+#------------------------------------------------------------------------------
+#------ 00011060: aaf3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011064: atf4's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011068: taf4's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001106c: .got entry for foo [R_ARM_RELATIVE]
+#------------------------------------------------------------------------------
+ 11060 28a00000 40a00000 49a00000 00000100 .*
+#------------------------------------------------------------------------------
+#------ 00011070: .got entry for foo [R_ARM_RELATIVE]
+#------ 00011074: .got entry for atf2 [R_ARM_GLOB_DAT]
+#------ 00011078: .got entry for aaf4 [R_ARM_GLOB_DAT]
+#------ 0001107c: .got entry for ttf2 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 11070 00000100 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00011080: .got entry for tbf2 [R_ARM_GLOB_DAT]
+#------ 00011084: .got entry for taf2 [R_ARM_GLOB_DAT]
+#------ 00011088: .got entry for aaf2 [R_ARM_GLOB_DAT]
+#------ 0001108c: .got entry for abf4 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 11080 00000000 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00011090: .got entry for tbf4 [R_ARM_GLOB_DAT]
+#------ 00011094: .got entry for ttf4 [R_ARM_GLOB_DAT]
+#------ 00011098: .got entry for atf4 [R_ARM_GLOB_DAT]
+#------ 0001109c: .got entry for taf4 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 11090 00000000 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 000110a0: .got entry for abf2 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 110a0 00000000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-4.rd b/ld/testsuite/ld-arm/ifunc-4.rd
new file mode 100644
index 0000000000..b8079d5c61
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-4.rd
@@ -0,0 +1,74 @@
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 62 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001106c ......17 R_ARM_RELATIVE
+00011070 ......17 R_ARM_RELATIVE
+00010004 ......a0 R_ARM_IRELATIVE
+0001000c ......a0 R_ARM_IRELATIVE
+00010014 ......a0 R_ARM_IRELATIVE
+0001001c ......a0 R_ARM_IRELATIVE
+00010024 ......a0 R_ARM_IRELATIVE
+0001002c ......a0 R_ARM_IRELATIVE
+00010064 ......a0 R_ARM_IRELATIVE
+0001006c ......a0 R_ARM_IRELATIVE
+00010074 ......a0 R_ARM_IRELATIVE
+0001007c ......a0 R_ARM_IRELATIVE
+00010084 ......a0 R_ARM_IRELATIVE
+0001008c ......a0 R_ARM_IRELATIVE
+00011024 ......a0 R_ARM_IRELATIVE
+00011028 ......a0 R_ARM_IRELATIVE
+0001102c ......a0 R_ARM_IRELATIVE
+00011030 ......a0 R_ARM_IRELATIVE
+00011034 ......a0 R_ARM_IRELATIVE
+00011038 ......a0 R_ARM_IRELATIVE
+0001103c ......a0 R_ARM_IRELATIVE
+00011040 ......a0 R_ARM_IRELATIVE
+00011044 ......a0 R_ARM_IRELATIVE
+00011048 ......a0 R_ARM_IRELATIVE
+0001104c ......a0 R_ARM_IRELATIVE
+00011050 ......a0 R_ARM_IRELATIVE
+00011054 ......a0 R_ARM_IRELATIVE
+00011058 ......a0 R_ARM_IRELATIVE
+0001105c ......a0 R_ARM_IRELATIVE
+00011060 ......a0 R_ARM_IRELATIVE
+00011064 ......a0 R_ARM_IRELATIVE
+00011068 ......a0 R_ARM_IRELATIVE
+00010034 ......02 R_ARM_ABS32 aaf2\(\) aaf2
+00010038 ......03 R_ARM_REL32 aaf2\(\) aaf2
+00011088 ......15 R_ARM_GLOB_DAT aaf2\(\) aaf2
+0001003c ......02 R_ARM_ABS32 atf2\(\) atf2
+00010040 ......03 R_ARM_REL32 atf2\(\) atf2
+00011074 ......15 R_ARM_GLOB_DAT atf2\(\) atf2
+00010044 ......02 R_ARM_ABS32 abf2\(\) abf2
+00010048 ......03 R_ARM_REL32 abf2\(\) abf2
+000110a0 ......15 R_ARM_GLOB_DAT abf2\(\) abf2
+0001004c ......02 R_ARM_ABS32 taf2\(\) taf2
+00010050 ......03 R_ARM_REL32 taf2\(\) taf2
+00011084 ......15 R_ARM_GLOB_DAT taf2\(\) taf2
+00010054 ......02 R_ARM_ABS32 ttf2\(\) ttf2
+00010058 ......03 R_ARM_REL32 ttf2\(\) ttf2
+0001107c ......15 R_ARM_GLOB_DAT ttf2\(\) ttf2
+0001005c ......02 R_ARM_ABS32 tbf2\(\) tbf2
+00010060 ......03 R_ARM_REL32 tbf2\(\) tbf2
+00011080 ......15 R_ARM_GLOB_DAT tbf2\(\) tbf2
+00010094 ......02 R_ARM_ABS32 aaf4\(\) aaf4
+00011078 ......15 R_ARM_GLOB_DAT aaf4\(\) aaf4
+0001009c ......02 R_ARM_ABS32 atf4\(\) atf4
+00011098 ......15 R_ARM_GLOB_DAT atf4\(\) atf4
+000100a4 ......02 R_ARM_ABS32 abf4\(\) abf4
+0001108c ......15 R_ARM_GLOB_DAT abf4\(\) abf4
+000100ac ......02 R_ARM_ABS32 taf4\(\) taf4
+0001109c ......15 R_ARM_GLOB_DAT taf4\(\) taf4
+000100b4 ......02 R_ARM_ABS32 ttf4\(\) ttf4
+00011094 ......15 R_ARM_GLOB_DAT ttf4\(\) ttf4
+000100bc ......02 R_ARM_ABS32 tbf4\(\) tbf4
+00011090 ......15 R_ARM_GLOB_DAT tbf4\(\) tbf4
+
+Relocation section '\.rel\.plt' at offset 0x81f0 contains 6 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......16 R_ARM_JUMP_SLOT atf2\(\) atf2
+00011010 ......16 R_ARM_JUMP_SLOT ttf2\(\) ttf2
+00011014 ......16 R_ARM_JUMP_SLOT tbf2\(\) tbf2
+00011018 ......16 R_ARM_JUMP_SLOT taf2\(\) taf2
+0001101c ......16 R_ARM_JUMP_SLOT aaf2\(\) aaf2
+00011020 ......16 R_ARM_JUMP_SLOT abf2\(\) abf2
diff --git a/ld/testsuite/ld-arm/ifunc-4.s b/ld/testsuite/ld-arm/ifunc-4.s
new file mode 100644
index 0000000000..7f72c8cadf
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-4.s
@@ -0,0 +1,95 @@
+ .syntax unified
+ .arch armv6t2
+
+ .macro define,name,type
+ .type \name,%gnu_indirect_function
+ \type
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro define2,name
+ define aa\name,.arm
+ define at\name,.arm
+ define ab\name,.arm
+ define ta\name,.thumb_func
+ define tt\name,.thumb_func
+ define tb\name,.thumb_func
+ .endm
+
+ .macro test_relocs,name,width
+ bl \name(PLT)
+ b\width \name
+ beq\width \name
+ ldr r4,1f
+ ldr r4,2f
+1:
+ .word \name(GOT)
+2:
+ .word \name(GOT_PREL)
+ .endm
+
+ .macro test_relocs2,name,type,width
+ test_relocs a\type\name,\width
+ test_relocs t\type\name,\width
+ test_relocs ab\name,\width
+ test_relocs tb\name,\width
+ .endm
+
+ .macro diff,name
+ .word \name
+ .word \name-.
+ .endm
+
+ .macro alldirs,doit,name
+ \doit aa\name
+ \doit at\name
+ \doit ab\name
+ \doit ta\name
+ \doit tt\name
+ \doit tb\name
+ .endm
+
+ define2 f1
+ define2 f2
+ define2 f3
+ define2 f4
+
+ alldirs .globl,f2
+
+ alldirs .globl,f3
+ alldirs .hidden,f3
+
+ alldirs .globl,f4
+ alldirs .protected,f4
+
+ .globl arm
+ .type arm,%function
+ .arm
+arm:
+ test_relocs foo
+ test_relocs2 f1,a,
+ test_relocs2 f2,a,
+ test_relocs2 f3,a,
+ test_relocs2 f4,a,
+ .size arm,.-arm
+
+ .globl _thumb
+ .type _thumb,%function
+ .thumb_func
+_thumb:
+ test_relocs foo
+ test_relocs2 f1,t,.w
+ test_relocs2 f2,t,.w
+ test_relocs2 f3,t,.w
+ test_relocs2 f4,t,.w
+ .size _thumb,.-_thumb
+
+ .data
+foo:
+ .word 0x11223344
+ alldirs diff,f1
+ alldirs diff,f2
+ alldirs diff,f3
+ alldirs diff,f4
diff --git a/ld/testsuite/ld-arm/ifunc-5.dd b/ld/testsuite/ld-arm/ifunc-5.dd
new file mode 100644
index 0000000000..90d7b21758
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-5.dd
@@ -0,0 +1,91 @@
+
+.*
+
+
+Disassembly of section \.iplt:
+
+00009000 <\.iplt>:
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ 9000: e28fc600 add ip, pc, #0
+ 9004: e28cca08 add ip, ip, #32768 ; 0x8000
+ 9008: e5bcf004 ldr pc, \[ip, #4\]!
+#------------------------------------------------------------------------------
+#------ f3's .iplt entry
+#------------------------------------------------------------------------------
+ 900c: e28fc600 add ip, pc, #0
+ 9010: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9014: e5bcfffc ldr pc, \[ip, #4092\]! ; 0xffc
+#------------------------------------------------------------------------------
+#------ f2's .iplt entry
+#------------------------------------------------------------------------------
+ 9018: e28fc600 add ip, pc, #0
+ 901c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9020: e5bcfff4 ldr pc, \[ip, #4084\]! ; 0xff4
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+
+0000a004 <f2>:
+ a004: e1a0f00e mov pc, lr
+
+0000a008 <f3>:
+ a008: e1a0f00e mov pc, lr
+
+0000a00c <_start>:
+ a00c: eb0017fb bl 10000 <foo>
+ a010: e59f4000 ldr r4, \[pc, #0\] ; a018 <_start\+0xc>
+ a014: e59f4000 ldr r4, \[pc, #0\] ; a01c <_start\+0x10>
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a018: 0000001c \.word 0x0000001c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a01c: 00006ffc \.word 0x00006ffc
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a020: ebfffbf6 bl 9000 <__irel_end\+0xfe8>
+ a024: e59f4000 ldr r4, \[pc, #0\] ; a02c <_start\+0x20>
+ a028: e59f4000 ldr r4, \[pc, #0\] ; a030 <_start\+0x24>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a02c: 0000000c \.word 0x0000000c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a030: 00006fdc \.word 0x00006fdc
+#------------------------------------------------------------------------------
+#------ f2's .iplt entry
+#------------------------------------------------------------------------------
+ a034: ebfffbf7 bl 9018 <__irel_end\+0x1000>
+ a038: e59f4000 ldr r4, \[pc, #0\] ; a040 <_start\+0x34>
+ a03c: e59f4000 ldr r4, \[pc, #0\] ; a044 <_start\+0x38>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f2's .igot.plt entry
+#------------------------------------------------------------------------------
+ a040: 00000014 \.word 0x00000014
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f2's .igot.plt entry
+#------------------------------------------------------------------------------
+ a044: 00006fd0 \.word 0x00006fd0
+#------------------------------------------------------------------------------
+#------ f3's .iplt entry
+#------------------------------------------------------------------------------
+ a048: ebfffbef bl 900c <__irel_end\+0xff4>
+ a04c: e59f4000 ldr r4, \[pc, #0\] ; a054 <_start\+0x48>
+ a050: e59f4000 ldr r4, \[pc, #0\] ; a058 <_start\+0x4c>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a054: 00000010 \.word 0x00000010
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a058: 00006fb8 \.word 0x00006fb8
diff --git a/ld/testsuite/ld-arm/ifunc-5.gd b/ld/testsuite/ld-arm/ifunc-5.gd
new file mode 100644
index 0000000000..8cd69df550
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-5.gd
@@ -0,0 +1,23 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------------------------------------------------------------------------------
+ 10000 44332211 00800000 18800000 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: f1's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11000 00000000 00000000 00000000 00a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: f3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011014: f2's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011018: .got entry for foo
+#------ 0001101c: .got entry for foo
+#------------------------------------------------------------------------------
+ 11010 08a00000 04a00000 00000100 00000100 .*
diff --git a/ld/testsuite/ld-arm/ifunc-5.rd b/ld/testsuite/ld-arm/ifunc-5.rd
new file mode 100644
index 0000000000..75e6d700bc
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-5.rd
@@ -0,0 +1,8 @@
+
+There is no dynamic section in this file\.
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 3 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......a0 R_ARM_IRELATIVE
+00011010 ......a0 R_ARM_IRELATIVE
+00011014 ......a0 R_ARM_IRELATIVE
diff --git a/ld/testsuite/ld-arm/ifunc-5.s b/ld/testsuite/ld-arm/ifunc-5.s
new file mode 100644
index 0000000000..9074c920d2
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-5.s
@@ -0,0 +1,39 @@
+ .macro define,name
+ .type \name,%gnu_indirect_function
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name
+ bl \name
+ ldr r4,1f
+ ldr r4,2f
+1:
+ .word \name(GOT)
+2:
+ .word \name(GOT_PREL)
+ .endm
+
+ .global f2
+
+ .global f3
+ .hidden f3
+
+ define f1
+ define f2
+ define f3
+
+ .globl _start
+_start:
+ test_relocs foo
+ test_relocs f1
+ test_relocs f2
+ test_relocs f3
+ .size _start,.-_start
+
+ .data
+foo:
+ .word 0x11223344
+ .word __irel_start
+ .word __irel_end
diff --git a/ld/testsuite/ld-arm/ifunc-6.dd b/ld/testsuite/ld-arm/ifunc-6.dd
new file mode 100644
index 0000000000..6715dceba9
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-6.dd
@@ -0,0 +1,175 @@
+
+.*
+
+
+Disassembly of section \.iplt:
+
+00009000 <\.iplt>:
+#------------------------------------------------------------------------------
+#------ thumb entry to f3's .iplt entry
+#------------------------------------------------------------------------------
+ 9000: 4778 bx pc
+ 9002: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ f3's .iplt entry
+#------------------------------------------------------------------------------
+ 9004: e28fc600 add ip, pc, #0
+ 9008: e28cca08 add ip, ip, #32768 ; 0x8000
+ 900c: e5bcf000 ldr pc, \[ip\]!
+#------------------------------------------------------------------------------
+#------ f2's .iplt entry
+#------------------------------------------------------------------------------
+ 9010: e28fc600 add ip, pc, #0
+ 9014: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9018: e5bcfff8 ldr pc, \[ip, #4088\]! ; 0xff8
+#------------------------------------------------------------------------------
+#------ thumb entry to f4's .iplt entry
+#------------------------------------------------------------------------------
+ 901c: 4778 bx pc
+ 901e: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ f4's .iplt entry
+#------------------------------------------------------------------------------
+ 9020: e28fc600 add ip, pc, #0
+ 9024: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9028: e5bcffec ldr pc, \[ip, #4076\]! ; 0xfec
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ 902c: e28fc600 add ip, pc, #0
+ 9030: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9034: e5bcffe4 ldr pc, \[ip, #4068\]! ; 0xfe4
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+
+0000a004 <f2>:
+ a004: 46f7 mov pc, lr
+ \.\.\.
+
+0000a008 <f3>:
+ a008: e1a0f00e mov pc, lr
+
+0000a00c <f4>:
+ a00c: 46f7 mov pc, lr
+ \.\.\.
+
+0000a010 <_start>:
+ a010: eb0017fa bl 10000 <foo>
+ a014: ea0017f9 b 10000 <foo>
+ a018: 0a0017f8 beq 10000 <foo>
+ a01c: e59f4000 ldr r4, \[pc, #0\] ; a024 <_start\+0x14>
+ a020: e59f4000 ldr r4, \[pc, #0\] ; a028 <_start\+0x18>
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a024: 00000020 \.word 0x00000020
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a028: 00006ff4 \.word 0x00006ff4
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a02c: ebfffbfe bl 902c <__irel_end\+0x100c>
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a030: eafffbfd b 902c <__irel_end\+0x100c>
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a034: 0afffbfc beq 902c <__irel_end\+0x100c>
+ a038: e59f4000 ldr r4, \[pc, #0\] ; a040 <_start\+0x30>
+ a03c: e59f4000 ldr r4, \[pc, #0\] ; a044 <_start\+0x34>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a040: 00000018 \.word 0x00000018
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a044: 00006fd4 \.word 0x00006fd4
+#------------------------------------------------------------------------------
+#------ f2's .iplt entry
+#------------------------------------------------------------------------------
+ a048: ebfffbf0 bl 9010 <__irel_end\+0xff0>
+#------------------------------------------------------------------------------
+#------ f2's .iplt entry
+#------------------------------------------------------------------------------
+ a04c: eafffbef b 9010 <__irel_end\+0xff0>
+#------------------------------------------------------------------------------
+#------ f2's .iplt entry
+#------------------------------------------------------------------------------
+ a050: 0afffbee beq 9010 <__irel_end\+0xff0>
+ a054: e59f4000 ldr r4, \[pc, #0\] ; a05c <_start\+0x4c>
+ a058: e59f4000 ldr r4, \[pc, #0\] ; a060 <_start\+0x50>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f2's .igot.plt entry
+#------------------------------------------------------------------------------
+ a05c: 00000010 \.word 0x00000010
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f2's .igot.plt entry
+#------------------------------------------------------------------------------
+ a060: 00006fb0 \.word 0x00006fb0
+
+0000a064 <_thumb>:
+ a064: f005 ffcc bl 10000 <foo>
+ a068: f005 bfca b\.w 10000 <foo>
+ a06c: f005 87c8 beq\.w 10000 <foo>
+ a070: 4c00 ldr r4, \[pc, #0\] ; \(a074 <_thumb\+0x10>\)
+ a072: 4c01 ldr r4, \[pc, #4\] ; \(a078 <_thumb\+0x14>\)
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a074: 00000020 \.word 0x00000020
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a078: 00006fa4 \.word 0x00006fa4
+#------------------------------------------------------------------------------
+#------ f3's .iplt entry
+#------------------------------------------------------------------------------
+ a07c: f7fe efc2 blx 9004 <__irel_end\+0xfe4>
+#------------------------------------------------------------------------------
+#------ thumb entry to f3's .iplt entry
+#------------------------------------------------------------------------------
+ a080: f7fe bfbe b\.w 9000 <__irel_end\+0xfe0>
+#------------------------------------------------------------------------------
+#------ thumb entry to f3's .iplt entry
+#------------------------------------------------------------------------------
+ a084: f43e afbc beq\.w 9000 <__irel_end\+0xfe0>
+ a088: 4c00 ldr r4, \[pc, #0\] ; \(a08c <_thumb\+0x28>\)
+ a08a: 4c01 ldr r4, \[pc, #4\] ; \(a090 <_thumb\+0x2c>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a08c: 0000000c \.word 0x0000000c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a090: 00006f7c \.word 0x00006f7c
+#------------------------------------------------------------------------------
+#------ f4's .iplt entry
+#------------------------------------------------------------------------------
+ a094: f7fe efc4 blx 9020 <__irel_end\+0x1000>
+#------------------------------------------------------------------------------
+#------ thumb entry to f4's .iplt entry
+#------------------------------------------------------------------------------
+ a098: f7fe bfc0 b\.w 901c <__irel_end\+0xffc>
+#------------------------------------------------------------------------------
+#------ thumb entry to f4's .iplt entry
+#------------------------------------------------------------------------------
+ a09c: f43e afbe beq\.w 901c <__irel_end\+0xffc>
+ a0a0: 4c00 ldr r4, \[pc, #0\] ; \(a0a4 <_thumb\+0x40>\)
+ a0a2: 4c01 ldr r4, \[pc, #4\] ; \(a0a8 <_thumb\+0x44>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f4's .igot.plt entry
+#------------------------------------------------------------------------------
+ a0a4: 00000014 \.word 0x00000014
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f4's .igot.plt entry
+#------------------------------------------------------------------------------
+ a0a8: 00006f6c \.word 0x00006f6c
diff --git a/ld/testsuite/ld-arm/ifunc-6.gd b/ld/testsuite/ld-arm/ifunc-6.gd
new file mode 100644
index 0000000000..45fd91421e
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-6.gd
@@ -0,0 +1,27 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------------------------------------------------------------------------------
+ 10000 44332211 00800000 20800000 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: f3's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11000 00000000 00000000 00000000 08a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: f2's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011014: f4's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011018: f1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001101c: .got entry for foo
+#------------------------------------------------------------------------------
+ 11010 05a00000 0da00000 00a00000 00000100 .*
+#------------------------------------------------------------------------------
+#------ 00011020: .got entry for foo
+#------------------------------------------------------------------------------
+ 11020 00000100 .*
diff --git a/ld/testsuite/ld-arm/ifunc-6.rd b/ld/testsuite/ld-arm/ifunc-6.rd
new file mode 100644
index 0000000000..0fbfec5905
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-6.rd
@@ -0,0 +1,9 @@
+
+There is no dynamic section in this file\.
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 4 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......a0 R_ARM_IRELATIVE
+00011010 ......a0 R_ARM_IRELATIVE
+00011014 ......a0 R_ARM_IRELATIVE
+00011018 ......a0 R_ARM_IRELATIVE
diff --git a/ld/testsuite/ld-arm/ifunc-6.s b/ld/testsuite/ld-arm/ifunc-6.s
new file mode 100644
index 0000000000..4596fa37f1
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-6.s
@@ -0,0 +1,59 @@
+ .syntax unified
+ .arch armv6t2
+
+ .macro define,name,type
+ .type \name,%gnu_indirect_function
+ \type
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name,width
+ bl\width \name
+ b\width \name
+ beq\width \name
+ ldr r4,1f
+ ldr r4,2f
+1:
+ .word \name(GOT)
+2:
+ .word \name(GOT_PREL)
+ .endm
+
+ .global f1
+ .global f2
+
+ .global f3
+ .global f4
+ .hidden f3
+ .hidden f4
+
+ define f1,.arm
+ define f2,.thumb_func
+ define f3,.arm
+ define f4,.thumb_func
+
+ .globl _start
+ .type _start,%function
+ .arm
+_start:
+ test_relocs foo
+ test_relocs f1,
+ test_relocs f2,
+ .size _start,.-_start
+
+ .globl _thumb
+ .type _thumb,%function
+ .thumb_func
+_thumb:
+ test_relocs foo
+ test_relocs f3,.w
+ test_relocs f4,.w
+ .size _thumb,.-_thumb
+
+ .data
+foo:
+ .word 0x11223344
+ .word __irel_start
+ .word __irel_end
diff --git a/ld/testsuite/ld-arm/ifunc-7.dd b/ld/testsuite/ld-arm/ifunc-7.dd
new file mode 100644
index 0000000000..c64e748568
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-7.dd
@@ -0,0 +1,120 @@
+
+.*
+
+
+Disassembly of section \.plt:
+
+00009000 <\.plt>:
+ 9000: e52de004 push {lr} ; \(str lr, \[sp, #-4\]!\)
+ 9004: e59fe004 ldr lr, \[pc, #4\] ; 9010 <f1-0xff0>
+ 9008: e08fe00e add lr, pc, lr
+ 900c: e5bef008 ldr pc, \[lr, #8\]!
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got.plt
+#------------------------------------------------------------------------------
+ 9010: 00007ff0 \.word 0x00007ff0
+#------------------------------------------------------------------------------
+#------ f2's .plt entry
+#------------------------------------------------------------------------------
+ 9014: e28fc600 add ip, pc, #0
+ 9018: e28cca07 add ip, ip, #28672 ; 0x7000
+ 901c: e5bcfff0 ldr pc, \[ip, #4080\]! ; 0xff0
+#------------------------------------------------------------------------------
+#------ f4's .plt entry
+#------------------------------------------------------------------------------
+ 9020: e28fc600 add ip, pc, #0
+ 9024: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9028: e5bcffe8 ldr pc, \[ip, #4072\]! ; 0xfe8
+
+Disassembly of section \.iplt:
+
+0000902c <\.iplt>:
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ 902c: e28fc600 add ip, pc, #0
+ 9030: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9034: e5bcffe0 ldr pc, \[ip, #4064\]! ; 0xfe0
+#------------------------------------------------------------------------------
+#------ f3's .iplt entry
+#------------------------------------------------------------------------------
+ 9038: e28fc600 add ip, pc, #0
+ 903c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9040: e5bcffd8 ldr pc, \[ip, #4056\]! ; 0xfd8
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+
+0000a004 <f3>:
+ a004: e1a0f00e mov pc, lr
+
+0000a008 <arm>:
+ a008: eb0017fc bl 10000 <foo>
+ a00c: e59f4000 ldr r4, \[pc, #0\] ; a014 <arm\+0xc>
+ a010: e59f4000 ldr r4, \[pc, #0\] ; a018 <arm\+0x10>
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a014: 00000020 \.word 0x00000020
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a018: 00007004 \.word 0x00007004
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a01c: ebfffc02 bl 902c <f1-0xfd4>
+ a020: e59f4000 ldr r4, \[pc, #0\] ; a028 <arm\+0x20>
+ a024: e59f4000 ldr r4, \[pc, #0\] ; a02c <arm\+0x24>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a028: 00000014 \.word 0x00000014
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a02c: 00006fe8 \.word 0x00006fe8
+#------------------------------------------------------------------------------
+#------ f2's .plt entry
+#------------------------------------------------------------------------------
+ a030: ebfffbf7 bl 9014 <f1-0xfec>
+ a034: e59f4000 ldr r4, \[pc, #0\] ; a03c <arm\+0x34>
+ a038: e59f4000 ldr r4, \[pc, #0\] ; a040 <arm\+0x38>
+#------------------------------------------------------------------------------
+#------ .got offset for f2
+#------------------------------------------------------------------------------
+ a03c: 00000024 \.word 0x00000024
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f2
+#------------------------------------------------------------------------------
+ a040: 00006fe4 \.word 0x00006fe4
+#------------------------------------------------------------------------------
+#------ f3's .iplt entry
+#------------------------------------------------------------------------------
+ a044: ebfffbfb bl 9038 <f1-0xfc8>
+ a048: e59f4000 ldr r4, \[pc, #0\] ; a050 <arm\+0x48>
+ a04c: e59f4000 ldr r4, \[pc, #0\] ; a054 <arm\+0x4c>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a050: 00000018 \.word 0x00000018
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a054: 00006fc4 \.word 0x00006fc4
+#------------------------------------------------------------------------------
+#------ f4's .plt entry
+#------------------------------------------------------------------------------
+ a058: ebfffbf0 bl 9020 <f1-0xfe0>
+ a05c: e59f4000 ldr r4, \[pc, #0\] ; a064 <arm\+0x5c>
+ a060: e59f4000 ldr r4, \[pc, #0\] ; a068 <arm\+0x60>
+#------------------------------------------------------------------------------
+#------ .got offset for f4
+#------------------------------------------------------------------------------
+ a064: 00000028 \.word 0x00000028
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f4
+#------------------------------------------------------------------------------
+ a068: 00006fc0 \.word 0x00006fc0
diff --git a/ld/testsuite/ld-arm/ifunc-7.gd b/ld/testsuite/ld-arm/ifunc-7.gd
new file mode 100644
index 0000000000..a116aafef0
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-7.gd
@@ -0,0 +1,45 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------ 00010004: contains foo [R_ARM_RELATIVE]
+#------ 00010008: contains PC-relative offset of foo
+#------ 0001000c: contains f1 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10000 44332211 00000100 f8ffffff 00a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010010: contains PC-relative offset of f1's .iplt entry
+#------ 00010014: f2 [R_ARM_ABS32]
+#------ 00010018: f2 [R_ARM_REL32]
+#------ 0001001c: contains f3 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10010 1c90ffff 00000000 00000000 04a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010020: contains PC-relative offset of f3's .iplt entry
+#------ 00010024: f4 [R_ARM_ABS32]
+#------ 00010028: f4 [R_ARM_REL32]
+#------------------------------------------------------------------------------
+ 10020 1890ffff 00000000 00000000 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: f2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11000 00200100 00000000 00000000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: f4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011014: f1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011018: f3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001101c: .got entry for foo [R_ARM_RELATIVE]
+#------------------------------------------------------------------------------
+ 11010 00900000 00a00000 04a00000 00000100 .*
+#------------------------------------------------------------------------------
+#------ 00011020: .got entry for foo [R_ARM_RELATIVE]
+#------ 00011024: .got entry for f2 [R_ARM_GLOB_DAT]
+#------ 00011028: .got entry for f4 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 11020 00000100 00000000 00000000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-7.rd b/ld/testsuite/ld-arm/ifunc-7.rd
new file mode 100644
index 0000000000..a29b184d36
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-7.rd
@@ -0,0 +1,21 @@
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 13 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+00010004 ......17 R_ARM_RELATIVE
+0001101c ......17 R_ARM_RELATIVE
+00011020 ......17 R_ARM_RELATIVE
+0001000c ......a0 R_ARM_IRELATIVE
+0001001c ......a0 R_ARM_IRELATIVE
+00011014 ......a0 R_ARM_IRELATIVE
+00011018 ......a0 R_ARM_IRELATIVE
+00010014 ......02 R_ARM_ABS32 00000000 f2
+00010018 ......03 R_ARM_REL32 00000000 f2
+00011024 ......15 R_ARM_GLOB_DAT 00000000 f2
+00010024 ......02 R_ARM_ABS32 00000000 f4
+00010028 ......03 R_ARM_REL32 00000000 f4
+00011028 ......15 R_ARM_GLOB_DAT 00000000 f4
+
+Relocation section '\.rel\.plt' at offset 0x8068 contains 2 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......16 R_ARM_JUMP_SLOT 00000000 f2
+00011010 ......16 R_ARM_JUMP_SLOT 00000000 f4
diff --git a/ld/testsuite/ld-arm/ifunc-7.s b/ld/testsuite/ld-arm/ifunc-7.s
new file mode 100644
index 0000000000..85ffb686c1
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-7.s
@@ -0,0 +1,42 @@
+ .macro define,name
+ .text
+ .type \name,%gnu_indirect_function
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name
+ bl \name(PLT)
+ ldr r4,1f
+ ldr r4,2f
+1:
+ .word \name(GOT)
+2:
+ .word \name(GOT_PREL)
+
+ .data
+ .word \name
+ .word \name - .
+ .text
+ .endm
+
+ .globl f3
+ .hidden f3
+
+ define f1
+ define f3
+
+ .data
+foo:
+ .word 0x11223344
+
+ .text
+ .globl arm
+arm:
+ test_relocs foo
+ test_relocs f1
+ test_relocs f2
+ test_relocs f3
+ test_relocs f4
+ .size arm,.-arm
diff --git a/ld/testsuite/ld-arm/ifunc-8.dd b/ld/testsuite/ld-arm/ifunc-8.dd
new file mode 100644
index 0000000000..67978bba5f
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-8.dd
@@ -0,0 +1,1017 @@
+
+.*
+
+
+Disassembly of section \.plt:
+
+00009000 <\.plt>:
+ 9000: e52de004 push {lr} ; \(str lr, \[sp, #-4\]!\)
+ 9004: e59fe004 ldr lr, \[pc, #4\] ; 9010 <aaf1-0xff0>
+ 9008: e08fe00e add lr, pc, lr
+ 900c: e5bef008 ldr pc, \[lr, #8\]!
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got.plt
+#------------------------------------------------------------------------------
+ 9010: 00007ff0 \.word 0x00007ff0
+#------------------------------------------------------------------------------
+#------ thumb entry to atf2's .plt entry
+#------------------------------------------------------------------------------
+ 9014: 4778 bx pc
+ 9016: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ atf2's .plt entry
+#------------------------------------------------------------------------------
+ 9018: e28fc600 add ip, pc, #0
+ 901c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9020: e5bcffec ldr pc, \[ip, #4076\]! ; 0xfec
+#------------------------------------------------------------------------------
+#------ aaf4's .plt entry
+#------------------------------------------------------------------------------
+ 9024: e28fc600 add ip, pc, #0
+ 9028: e28cca07 add ip, ip, #28672 ; 0x7000
+ 902c: e5bcffe4 ldr pc, \[ip, #4068\]! ; 0xfe4
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf2's .plt entry
+#------------------------------------------------------------------------------
+ 9030: 4778 bx pc
+ 9032: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ ttf2's .plt entry
+#------------------------------------------------------------------------------
+ 9034: e28fc600 add ip, pc, #0
+ 9038: e28cca07 add ip, ip, #28672 ; 0x7000
+ 903c: e5bcffd8 ldr pc, \[ip, #4056\]! ; 0xfd8
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf2's .plt entry
+#------------------------------------------------------------------------------
+ 9040: 4778 bx pc
+ 9042: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ 9044: e28fc600 add ip, pc, #0
+ 9048: e28cca07 add ip, ip, #28672 ; 0x7000
+ 904c: e5bcffcc ldr pc, \[ip, #4044\]! ; 0xfcc
+#------------------------------------------------------------------------------
+#------ taf2's .plt entry
+#------------------------------------------------------------------------------
+ 9050: e28fc600 add ip, pc, #0
+ 9054: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9058: e5bcffc4 ldr pc, \[ip, #4036\]! ; 0xfc4
+#------------------------------------------------------------------------------
+#------ aaf2's .plt entry
+#------------------------------------------------------------------------------
+ 905c: e28fc600 add ip, pc, #0
+ 9060: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9064: e5bcffbc ldr pc, \[ip, #4028\]! ; 0xfbc
+#------------------------------------------------------------------------------
+#------ thumb entry to abf4's .plt entry
+#------------------------------------------------------------------------------
+ 9068: 4778 bx pc
+ 906a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ abf4's .plt entry
+#------------------------------------------------------------------------------
+ 906c: e28fc600 add ip, pc, #0
+ 9070: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9074: e5bcffb0 ldr pc, \[ip, #4016\]! ; 0xfb0
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf4's .plt entry
+#------------------------------------------------------------------------------
+ 9078: 4778 bx pc
+ 907a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ tbf4's .plt entry
+#------------------------------------------------------------------------------
+ 907c: e28fc600 add ip, pc, #0
+ 9080: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9084: e5bcffa4 ldr pc, \[ip, #4004\]! ; 0xfa4
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf4's .plt entry
+#------------------------------------------------------------------------------
+ 9088: 4778 bx pc
+ 908a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ ttf4's .plt entry
+#------------------------------------------------------------------------------
+ 908c: e28fc600 add ip, pc, #0
+ 9090: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9094: e5bcff98 ldr pc, \[ip, #3992\]! ; 0xf98
+#------------------------------------------------------------------------------
+#------ thumb entry to atf4's .plt entry
+#------------------------------------------------------------------------------
+ 9098: 4778 bx pc
+ 909a: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ atf4's .plt entry
+#------------------------------------------------------------------------------
+ 909c: e28fc600 add ip, pc, #0
+ 90a0: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90a4: e5bcff8c ldr pc, \[ip, #3980\]! ; 0xf8c
+#------------------------------------------------------------------------------
+#------ taf4's .plt entry
+#------------------------------------------------------------------------------
+ 90a8: e28fc600 add ip, pc, #0
+ 90ac: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90b0: e5bcff84 ldr pc, \[ip, #3972\]! ; 0xf84
+#------------------------------------------------------------------------------
+#------ thumb entry to abf2's .plt entry
+#------------------------------------------------------------------------------
+ 90b4: 4778 bx pc
+ 90b6: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ 90b8: e28fc600 add ip, pc, #0
+ 90bc: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90c0: e5bcff78 ldr pc, \[ip, #3960\]! ; 0xf78
+
+Disassembly of section \.iplt:
+
+000090c4 <\.iplt>:
+#------------------------------------------------------------------------------
+#------ aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90c4: e28fc600 add ip, pc, #0
+ 90c8: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90cc: e5bcff70 ldr pc, \[ip, #3952\]! ; 0xf70
+#------------------------------------------------------------------------------
+#------ thumb entry to atf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90d0: 4778 bx pc
+ 90d2: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ atf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90d4: e28fc600 add ip, pc, #0
+ 90d8: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90dc: e5bcff64 ldr pc, \[ip, #3940\]! ; 0xf64
+#------------------------------------------------------------------------------
+#------ thumb entry to abf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90e0: 4778 bx pc
+ 90e2: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90e4: e28fc600 add ip, pc, #0
+ 90e8: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90ec: e5bcff58 ldr pc, \[ip, #3928\]! ; 0xf58
+#------------------------------------------------------------------------------
+#------ taf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90f0: e28fc600 add ip, pc, #0
+ 90f4: e28cca07 add ip, ip, #28672 ; 0x7000
+ 90f8: e5bcff50 ldr pc, \[ip, #3920\]! ; 0xf50
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ 90fc: 4778 bx pc
+ 90fe: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ 9100: e28fc600 add ip, pc, #0
+ 9104: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9108: e5bcff44 ldr pc, \[ip, #3908\]! ; 0xf44
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ 910c: 4778 bx pc
+ 910e: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ 9110: e28fc600 add ip, pc, #0
+ 9114: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9118: e5bcff38 ldr pc, \[ip, #3896\]! ; 0xf38
+#------------------------------------------------------------------------------
+#------ thumb entry to atf3's .iplt entry
+#------------------------------------------------------------------------------
+ 911c: 4778 bx pc
+ 911e: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ atf3's .iplt entry
+#------------------------------------------------------------------------------
+ 9120: e28fc600 add ip, pc, #0
+ 9124: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9128: e5bcff2c ldr pc, \[ip, #3884\]! ; 0xf2c
+#------------------------------------------------------------------------------
+#------ thumb entry to abf3's .iplt entry
+#------------------------------------------------------------------------------
+ 912c: 4778 bx pc
+ 912e: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ abf3's .iplt entry
+#------------------------------------------------------------------------------
+ 9130: e28fc600 add ip, pc, #0
+ 9134: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9138: e5bcff20 ldr pc, \[ip, #3872\]! ; 0xf20
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf3's .iplt entry
+#------------------------------------------------------------------------------
+ 913c: 4778 bx pc
+ 913e: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ ttf3's .iplt entry
+#------------------------------------------------------------------------------
+ 9140: e28fc600 add ip, pc, #0
+ 9144: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9148: e5bcff14 ldr pc, \[ip, #3860\]! ; 0xf14
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ 914c: 4778 bx pc
+ 914e: 46c0 nop ; \(mov r8, r8\)
+#------------------------------------------------------------------------------
+#------ tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ 9150: e28fc600 add ip, pc, #0
+ 9154: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9158: e5bcff08 ldr pc, \[ip, #3848\]! ; 0xf08
+#------------------------------------------------------------------------------
+#------ taf3's .iplt entry
+#------------------------------------------------------------------------------
+ 915c: e28fc600 add ip, pc, #0
+ 9160: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9164: e5bcff00 ldr pc, \[ip, #3840\]! ; 0xf00
+#------------------------------------------------------------------------------
+#------ aaf3's .iplt entry
+#------------------------------------------------------------------------------
+ 9168: e28fc600 add ip, pc, #0
+ 916c: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9170: e5bcfef8 ldr pc, \[ip, #3832\]! ; 0xef8
+
+Disassembly of section \.text:
+
+0000a000 <aaf1>:
+ a000: e1a0f00e mov pc, lr
+
+0000a004 <atf1>:
+ a004: e1a0f00e mov pc, lr
+
+0000a008 <abf1>:
+ a008: e1a0f00e mov pc, lr
+
+0000a00c <taf1>:
+ a00c: 46f7 mov pc, lr
+
+0000a00e <ttf1>:
+ a00e: 46f7 mov pc, lr
+
+0000a010 <tbf1>:
+ a010: 46f7 mov pc, lr
+ \.\.\.
+
+0000a014 <aaf3>:
+ a014: e1a0f00e mov pc, lr
+
+0000a018 <atf3>:
+ a018: e1a0f00e mov pc, lr
+
+0000a01c <abf3>:
+ a01c: e1a0f00e mov pc, lr
+
+0000a020 <taf3>:
+ a020: 46f7 mov pc, lr
+
+0000a022 <ttf3>:
+ a022: 46f7 mov pc, lr
+
+0000a024 <tbf3>:
+ a024: 46f7 mov pc, lr
+ \.\.\.
+
+0000a028 <arm>:
+ a028: eb0017f4 bl 10000 <foo>
+ a02c: ea0017f3 b 10000 <foo>
+ a030: 0a0017f2 beq 10000 <foo>
+ a034: e59f4000 ldr r4, \[pc, #0\] ; a03c <arm\+0x14>
+ a038: e59f4000 ldr r4, \[pc, #0\] ; a040 <arm\+0x18>
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a03c: 00000070 \.word 0x00000070
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a040: 0000702c \.word 0x0000702c
+#------------------------------------------------------------------------------
+#------ aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ a044: ebfffc1e bl 90c4 <aaf1-0xf3c>
+#------------------------------------------------------------------------------
+#------ aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ a048: eafffc1d b 90c4 <aaf1-0xf3c>
+#------------------------------------------------------------------------------
+#------ aaf1's .iplt entry
+#------------------------------------------------------------------------------
+ a04c: 0afffc1c beq 90c4 <aaf1-0xf3c>
+ a050: e59f4000 ldr r4, \[pc, #0\] ; a058 <arm\+0x30>
+ a054: e59f4000 ldr r4, \[pc, #0\] ; a05c <arm\+0x34>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of aaf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a058: 0000003c \.word 0x0000003c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of aaf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a05c: 00006fe0 \.word 0x00006fe0
+#------------------------------------------------------------------------------
+#------ taf1's .iplt entry
+#------------------------------------------------------------------------------
+ a060: ebfffc22 bl 90f0 <aaf1-0xf10>
+#------------------------------------------------------------------------------
+#------ taf1's .iplt entry
+#------------------------------------------------------------------------------
+ a064: eafffc21 b 90f0 <aaf1-0xf10>
+#------------------------------------------------------------------------------
+#------ taf1's .iplt entry
+#------------------------------------------------------------------------------
+ a068: 0afffc20 beq 90f0 <aaf1-0xf10>
+ a06c: e59f4000 ldr r4, \[pc, #0\] ; a074 <arm\+0x4c>
+ a070: e59f4000 ldr r4, \[pc, #0\] ; a078 <arm\+0x50>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of taf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a074: 00000048 \.word 0x00000048
+#------------------------------------------------------------------------------
+#------ PC-relative offset of taf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a078: 00006fd0 \.word 0x00006fd0
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a07c: ebfffc18 bl 90e4 <aaf1-0xf1c>
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a080: eafffc17 b 90e4 <aaf1-0xf1c>
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a084: 0afffc16 beq 90e4 <aaf1-0xf1c>
+ a088: e59f4000 ldr r4, \[pc, #0\] ; a090 <arm\+0x68>
+ a08c: e59f4000 ldr r4, \[pc, #0\] ; a094 <arm\+0x6c>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of abf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a090: 00000044 \.word 0x00000044
+#------------------------------------------------------------------------------
+#------ PC-relative offset of abf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a094: 00006fb0 \.word 0x00006fb0
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a098: ebfffc1c bl 9110 <aaf1-0xef0>
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a09c: eafffc1b b 9110 <aaf1-0xef0>
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a0a0: 0afffc1a beq 9110 <aaf1-0xef0>
+ a0a4: e59f4000 ldr r4, \[pc, #0\] ; a0ac <arm\+0x84>
+ a0a8: e59f4000 ldr r4, \[pc, #0\] ; a0b0 <arm\+0x88>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of tbf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a0ac: 00000050 \.word 0x00000050
+#------------------------------------------------------------------------------
+#------ PC-relative offset of tbf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a0b0: 00006fa0 \.word 0x00006fa0
+#------------------------------------------------------------------------------
+#------ aaf2's .plt entry
+#------------------------------------------------------------------------------
+ a0b4: ebfffbe8 bl 905c <aaf1-0xfa4>
+#------------------------------------------------------------------------------
+#------ aaf2's .plt entry
+#------------------------------------------------------------------------------
+ a0b8: eafffbe7 b 905c <aaf1-0xfa4>
+#------------------------------------------------------------------------------
+#------ aaf2's .plt entry
+#------------------------------------------------------------------------------
+ a0bc: 0afffbe6 beq 905c <aaf1-0xfa4>
+ a0c0: e59f4000 ldr r4, \[pc, #0\] ; a0c8 <arm\+0xa0>
+ a0c4: e59f4000 ldr r4, \[pc, #0\] ; a0cc <arm\+0xa4>
+#------------------------------------------------------------------------------
+#------ .got offset for aaf2
+#------------------------------------------------------------------------------
+ a0c8: 00000088 \.word 0x00000088
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for aaf2
+#------------------------------------------------------------------------------
+ a0cc: 00006fbc \.word 0x00006fbc
+#------------------------------------------------------------------------------
+#------ taf2's .plt entry
+#------------------------------------------------------------------------------
+ a0d0: ebfffbde bl 9050 <aaf1-0xfb0>
+#------------------------------------------------------------------------------
+#------ taf2's .plt entry
+#------------------------------------------------------------------------------
+ a0d4: eafffbdd b 9050 <aaf1-0xfb0>
+#------------------------------------------------------------------------------
+#------ taf2's .plt entry
+#------------------------------------------------------------------------------
+ a0d8: 0afffbdc beq 9050 <aaf1-0xfb0>
+ a0dc: e59f4000 ldr r4, \[pc, #0\] ; a0e4 <arm\+0xbc>
+ a0e0: e59f4000 ldr r4, \[pc, #0\] ; a0e8 <arm\+0xc0>
+#------------------------------------------------------------------------------
+#------ .got offset for taf2
+#------------------------------------------------------------------------------
+ a0e4: 00000084 \.word 0x00000084
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for taf2
+#------------------------------------------------------------------------------
+ a0e8: 00006f9c \.word 0x00006f9c
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ a0ec: ebfffbf1 bl 90b8 <aaf1-0xf48>
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ a0f0: eafffbf0 b 90b8 <aaf1-0xf48>
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ a0f4: 0afffbef beq 90b8 <aaf1-0xf48>
+ a0f8: e59f4000 ldr r4, \[pc, #0\] ; a100 <arm\+0xd8>
+ a0fc: e59f4000 ldr r4, \[pc, #0\] ; a104 <arm\+0xdc>
+#------------------------------------------------------------------------------
+#------ .got offset for abf2
+#------------------------------------------------------------------------------
+ a100: 000000a0 \.word 0x000000a0
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf2
+#------------------------------------------------------------------------------
+ a104: 00006f9c \.word 0x00006f9c
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a108: ebfffbcd bl 9044 <aaf1-0xfbc>
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a10c: eafffbcc b 9044 <aaf1-0xfbc>
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a110: 0afffbcb beq 9044 <aaf1-0xfbc>
+ a114: e59f4000 ldr r4, \[pc, #0\] ; a11c <arm\+0xf4>
+ a118: e59f4000 ldr r4, \[pc, #0\] ; a120 <arm\+0xf8>
+#------------------------------------------------------------------------------
+#------ .got offset for tbf2
+#------------------------------------------------------------------------------
+ a11c: 00000080 \.word 0x00000080
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf2
+#------------------------------------------------------------------------------
+ a120: 00006f60 \.word 0x00006f60
+#------------------------------------------------------------------------------
+#------ aaf3's .iplt entry
+#------------------------------------------------------------------------------
+ a124: ebfffc0f bl 9168 <aaf1-0xe98>
+#------------------------------------------------------------------------------
+#------ aaf3's .iplt entry
+#------------------------------------------------------------------------------
+ a128: eafffc0e b 9168 <aaf1-0xe98>
+#------------------------------------------------------------------------------
+#------ aaf3's .iplt entry
+#------------------------------------------------------------------------------
+ a12c: 0afffc0d beq 9168 <aaf1-0xe98>
+ a130: e59f4000 ldr r4, \[pc, #0\] ; a138 <arm\+0x110>
+ a134: e59f4000 ldr r4, \[pc, #0\] ; a13c <arm\+0x114>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of aaf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a138: 00000068 \.word 0x00000068
+#------------------------------------------------------------------------------
+#------ PC-relative offset of aaf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a13c: 00006f2c \.word 0x00006f2c
+#------------------------------------------------------------------------------
+#------ taf3's .iplt entry
+#------------------------------------------------------------------------------
+ a140: ebfffc05 bl 915c <aaf1-0xea4>
+#------------------------------------------------------------------------------
+#------ taf3's .iplt entry
+#------------------------------------------------------------------------------
+ a144: eafffc04 b 915c <aaf1-0xea4>
+#------------------------------------------------------------------------------
+#------ taf3's .iplt entry
+#------------------------------------------------------------------------------
+ a148: 0afffc03 beq 915c <aaf1-0xea4>
+ a14c: e59f4000 ldr r4, \[pc, #0\] ; a154 <arm\+0x12c>
+ a150: e59f4000 ldr r4, \[pc, #0\] ; a158 <arm\+0x130>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of taf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a154: 00000064 \.word 0x00000064
+#------------------------------------------------------------------------------
+#------ PC-relative offset of taf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a158: 00006f0c \.word 0x00006f0c
+#------------------------------------------------------------------------------
+#------ abf3's .iplt entry
+#------------------------------------------------------------------------------
+ a15c: ebfffbf3 bl 9130 <aaf1-0xed0>
+#------------------------------------------------------------------------------
+#------ abf3's .iplt entry
+#------------------------------------------------------------------------------
+ a160: eafffbf2 b 9130 <aaf1-0xed0>
+#------------------------------------------------------------------------------
+#------ abf3's .iplt entry
+#------------------------------------------------------------------------------
+ a164: 0afffbf1 beq 9130 <aaf1-0xed0>
+ a168: e59f4000 ldr r4, \[pc, #0\] ; a170 <arm\+0x148>
+ a16c: e59f4000 ldr r4, \[pc, #0\] ; a174 <arm\+0x14c>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of abf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a170: 00000058 \.word 0x00000058
+#------------------------------------------------------------------------------
+#------ PC-relative offset of abf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a174: 00006ee4 \.word 0x00006ee4
+#------------------------------------------------------------------------------
+#------ tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ a178: ebfffbf4 bl 9150 <aaf1-0xeb0>
+#------------------------------------------------------------------------------
+#------ tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ a17c: eafffbf3 b 9150 <aaf1-0xeb0>
+#------------------------------------------------------------------------------
+#------ tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ a180: 0afffbf2 beq 9150 <aaf1-0xeb0>
+ a184: e59f4000 ldr r4, \[pc, #0\] ; a18c <arm\+0x164>
+ a188: e59f4000 ldr r4, \[pc, #0\] ; a190 <arm\+0x168>
+#------------------------------------------------------------------------------
+#------ GP-relative offset of tbf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a18c: 00000060 \.word 0x00000060
+#------------------------------------------------------------------------------
+#------ PC-relative offset of tbf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a190: 00006ed0 \.word 0x00006ed0
+#------------------------------------------------------------------------------
+#------ aaf4's .plt entry
+#------------------------------------------------------------------------------
+ a194: ebfffba2 bl 9024 <aaf1-0xfdc>
+#------------------------------------------------------------------------------
+#------ aaf4's .plt entry
+#------------------------------------------------------------------------------
+ a198: eafffba1 b 9024 <aaf1-0xfdc>
+#------------------------------------------------------------------------------
+#------ aaf4's .plt entry
+#------------------------------------------------------------------------------
+ a19c: 0afffba0 beq 9024 <aaf1-0xfdc>
+ a1a0: e59f4000 ldr r4, \[pc, #0\] ; a1a8 <arm\+0x180>
+ a1a4: e59f4000 ldr r4, \[pc, #0\] ; a1ac <arm\+0x184>
+#------------------------------------------------------------------------------
+#------ .got offset for aaf4
+#------------------------------------------------------------------------------
+ a1a8: 00000078 \.word 0x00000078
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for aaf4
+#------------------------------------------------------------------------------
+ a1ac: 00006ecc \.word 0x00006ecc
+#------------------------------------------------------------------------------
+#------ taf4's .plt entry
+#------------------------------------------------------------------------------
+ a1b0: ebfffbbc bl 90a8 <aaf1-0xf58>
+#------------------------------------------------------------------------------
+#------ taf4's .plt entry
+#------------------------------------------------------------------------------
+ a1b4: eafffbbb b 90a8 <aaf1-0xf58>
+#------------------------------------------------------------------------------
+#------ taf4's .plt entry
+#------------------------------------------------------------------------------
+ a1b8: 0afffbba beq 90a8 <aaf1-0xf58>
+ a1bc: e59f4000 ldr r4, \[pc, #0\] ; a1c4 <arm\+0x19c>
+ a1c0: e59f4000 ldr r4, \[pc, #0\] ; a1c8 <arm\+0x1a0>
+#------------------------------------------------------------------------------
+#------ .got offset for taf4
+#------------------------------------------------------------------------------
+ a1c4: 0000009c \.word 0x0000009c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for taf4
+#------------------------------------------------------------------------------
+ a1c8: 00006ed4 \.word 0x00006ed4
+#------------------------------------------------------------------------------
+#------ abf4's .plt entry
+#------------------------------------------------------------------------------
+ a1cc: ebfffba6 bl 906c <aaf1-0xf94>
+#------------------------------------------------------------------------------
+#------ abf4's .plt entry
+#------------------------------------------------------------------------------
+ a1d0: eafffba5 b 906c <aaf1-0xf94>
+#------------------------------------------------------------------------------
+#------ abf4's .plt entry
+#------------------------------------------------------------------------------
+ a1d4: 0afffba4 beq 906c <aaf1-0xf94>
+ a1d8: e59f4000 ldr r4, \[pc, #0\] ; a1e0 <arm\+0x1b8>
+ a1dc: e59f4000 ldr r4, \[pc, #0\] ; a1e4 <arm\+0x1bc>
+#------------------------------------------------------------------------------
+#------ .got offset for abf4
+#------------------------------------------------------------------------------
+ a1e0: 0000008c \.word 0x0000008c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf4
+#------------------------------------------------------------------------------
+ a1e4: 00006ea8 \.word 0x00006ea8
+#------------------------------------------------------------------------------
+#------ tbf4's .plt entry
+#------------------------------------------------------------------------------
+ a1e8: ebfffba3 bl 907c <aaf1-0xf84>
+#------------------------------------------------------------------------------
+#------ tbf4's .plt entry
+#------------------------------------------------------------------------------
+ a1ec: eafffba2 b 907c <aaf1-0xf84>
+#------------------------------------------------------------------------------
+#------ tbf4's .plt entry
+#------------------------------------------------------------------------------
+ a1f0: 0afffba1 beq 907c <aaf1-0xf84>
+ a1f4: e59f4000 ldr r4, \[pc, #0\] ; a1fc <arm\+0x1d4>
+ a1f8: e59f4000 ldr r4, \[pc, #0\] ; a200 <arm\+0x1d8>
+#------------------------------------------------------------------------------
+#------ .got offset for tbf4
+#------------------------------------------------------------------------------
+ a1fc: 00000090 \.word 0x00000090
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf4
+#------------------------------------------------------------------------------
+ a200: 00006e90 \.word 0x00006e90
+
+0000a204 <_thumb>:
+ a204: f005 fefc bl 10000 <foo>
+ a208: f005 befa b\.w 10000 <foo>
+ a20c: f005 86f8 beq\.w 10000 <foo>
+ a210: 4c00 ldr r4, \[pc, #0\] ; \(a214 <_thumb\+0x10>\)
+ a212: 4c01 ldr r4, \[pc, #4\] ; \(a218 <_thumb\+0x14>\)
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a214: 00000070 \.word 0x00000070
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a218: 00006e54 \.word 0x00006e54
+#------------------------------------------------------------------------------
+#------ atf1's .iplt entry
+#------------------------------------------------------------------------------
+ a21c: f7fe ef5a blx 90d4 <aaf1-0xf2c>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf1's .iplt entry
+#------------------------------------------------------------------------------
+ a220: f7fe bf56 b\.w 90d0 <aaf1-0xf30>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf1's .iplt entry
+#------------------------------------------------------------------------------
+ a224: f43e af54 beq\.w 90d0 <aaf1-0xf30>
+ a228: 4c00 ldr r4, \[pc, #0\] ; \(a22c <_thumb\+0x28>\)
+ a22a: 4c01 ldr r4, \[pc, #4\] ; \(a230 <_thumb\+0x2c>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of atf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a22c: 00000040 \.word 0x00000040
+#------------------------------------------------------------------------------
+#------ PC-relative offset of atf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a230: 00006e10 \.word 0x00006e10
+#------------------------------------------------------------------------------
+#------ ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ a234: f7fe ef64 blx 9100 <aaf1-0xf00>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ a238: f7fe bf60 b\.w 90fc <aaf1-0xf04>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf1's .iplt entry
+#------------------------------------------------------------------------------
+ a23c: f43e af5e beq\.w 90fc <aaf1-0xf04>
+ a240: 4c00 ldr r4, \[pc, #0\] ; \(a244 <_thumb\+0x40>\)
+ a242: 4c01 ldr r4, \[pc, #4\] ; \(a248 <_thumb\+0x44>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of ttf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a244: 0000004c \.word 0x0000004c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of ttf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a248: 00006e04 \.word 0x00006e04
+#------------------------------------------------------------------------------
+#------ abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a24c: f7fe ef4a blx 90e4 <aaf1-0xf1c>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a250: f7fe bf46 b\.w 90e0 <aaf1-0xf20>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf1's .iplt entry
+#------------------------------------------------------------------------------
+ a254: f43e af44 beq\.w 90e0 <aaf1-0xf20>
+ a258: 4c00 ldr r4, \[pc, #0\] ; \(a25c <_thumb\+0x58>\)
+ a25a: 4c01 ldr r4, \[pc, #4\] ; \(a260 <_thumb\+0x5c>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of abf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a25c: 00000044 \.word 0x00000044
+#------------------------------------------------------------------------------
+#------ PC-relative offset of abf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a260: 00006de4 \.word 0x00006de4
+#------------------------------------------------------------------------------
+#------ tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a264: f7fe ef54 blx 9110 <aaf1-0xef0>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a268: f7fe bf50 b\.w 910c <aaf1-0xef4>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf1's .iplt entry
+#------------------------------------------------------------------------------
+ a26c: f43e af4e beq\.w 910c <aaf1-0xef4>
+ a270: 4c00 ldr r4, \[pc, #0\] ; \(a274 <_thumb\+0x70>\)
+ a272: 4c01 ldr r4, \[pc, #4\] ; \(a278 <_thumb\+0x74>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of tbf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a274: 00000050 \.word 0x00000050
+#------------------------------------------------------------------------------
+#------ PC-relative offset of tbf1's .igot.plt entry
+#------------------------------------------------------------------------------
+ a278: 00006dd8 \.word 0x00006dd8
+#------------------------------------------------------------------------------
+#------ atf2's .plt entry
+#------------------------------------------------------------------------------
+ a27c: f7fe eecc blx 9018 <aaf1-0xfe8>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf2's .plt entry
+#------------------------------------------------------------------------------
+ a280: f7fe bec8 b\.w 9014 <aaf1-0xfec>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf2's .plt entry
+#------------------------------------------------------------------------------
+ a284: f43e aec6 beq\.w 9014 <aaf1-0xfec>
+ a288: 4c00 ldr r4, \[pc, #0\] ; \(a28c <_thumb\+0x88>\)
+ a28a: 4c01 ldr r4, \[pc, #4\] ; \(a290 <_thumb\+0x8c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for atf2
+#------------------------------------------------------------------------------
+ a28c: 00000074 \.word 0x00000074
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for atf2
+#------------------------------------------------------------------------------
+ a290: 00006de4 \.word 0x00006de4
+#------------------------------------------------------------------------------
+#------ ttf2's .plt entry
+#------------------------------------------------------------------------------
+ a294: f7fe eece blx 9034 <aaf1-0xfcc>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf2's .plt entry
+#------------------------------------------------------------------------------
+ a298: f7fe beca b\.w 9030 <aaf1-0xfd0>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf2's .plt entry
+#------------------------------------------------------------------------------
+ a29c: f43e aec8 beq\.w 9030 <aaf1-0xfd0>
+ a2a0: 4c00 ldr r4, \[pc, #0\] ; \(a2a4 <_thumb\+0xa0>\)
+ a2a2: 4c01 ldr r4, \[pc, #4\] ; \(a2a8 <_thumb\+0xa4>\)
+#------------------------------------------------------------------------------
+#------ .got offset for ttf2
+#------------------------------------------------------------------------------
+ a2a4: 0000007c \.word 0x0000007c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for ttf2
+#------------------------------------------------------------------------------
+ a2a8: 00006dd4 \.word 0x00006dd4
+#------------------------------------------------------------------------------
+#------ abf2's .plt entry
+#------------------------------------------------------------------------------
+ a2ac: f7fe ef04 blx 90b8 <aaf1-0xf48>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf2's .plt entry
+#------------------------------------------------------------------------------
+ a2b0: f7fe bf00 b\.w 90b4 <aaf1-0xf4c>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf2's .plt entry
+#------------------------------------------------------------------------------
+ a2b4: f43e aefe beq\.w 90b4 <aaf1-0xf4c>
+ a2b8: 4c00 ldr r4, \[pc, #0\] ; \(a2bc <_thumb\+0xb8>\)
+ a2ba: 4c01 ldr r4, \[pc, #4\] ; \(a2c0 <_thumb\+0xbc>\)
+#------------------------------------------------------------------------------
+#------ .got offset for abf2
+#------------------------------------------------------------------------------
+ a2bc: 000000a0 \.word 0x000000a0
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf2
+#------------------------------------------------------------------------------
+ a2c0: 00006de0 \.word 0x00006de0
+#------------------------------------------------------------------------------
+#------ tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a2c4: f7fe eebe blx 9044 <aaf1-0xfbc>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a2c8: f7fe beba b\.w 9040 <aaf1-0xfc0>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf2's .plt entry
+#------------------------------------------------------------------------------
+ a2cc: f43e aeb8 beq\.w 9040 <aaf1-0xfc0>
+ a2d0: 4c00 ldr r4, \[pc, #0\] ; \(a2d4 <_thumb\+0xd0>\)
+ a2d2: 4c01 ldr r4, \[pc, #4\] ; \(a2d8 <_thumb\+0xd4>\)
+#------------------------------------------------------------------------------
+#------ .got offset for tbf2
+#------------------------------------------------------------------------------
+ a2d4: 00000080 \.word 0x00000080
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf2
+#------------------------------------------------------------------------------
+ a2d8: 00006da8 \.word 0x00006da8
+#------------------------------------------------------------------------------
+#------ atf3's .iplt entry
+#------------------------------------------------------------------------------
+ a2dc: f7fe ef20 blx 9120 <aaf1-0xee0>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf3's .iplt entry
+#------------------------------------------------------------------------------
+ a2e0: f7fe bf1c b\.w 911c <aaf1-0xee4>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf3's .iplt entry
+#------------------------------------------------------------------------------
+ a2e4: f43e af1a beq\.w 911c <aaf1-0xee4>
+ a2e8: 4c00 ldr r4, \[pc, #0\] ; \(a2ec <_thumb\+0xe8>\)
+ a2ea: 4c01 ldr r4, \[pc, #4\] ; \(a2f0 <_thumb\+0xec>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of atf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a2ec: 00000054 \.word 0x00000054
+#------------------------------------------------------------------------------
+#------ PC-relative offset of atf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a2f0: 00006d64 \.word 0x00006d64
+#------------------------------------------------------------------------------
+#------ ttf3's .iplt entry
+#------------------------------------------------------------------------------
+ a2f4: f7fe ef24 blx 9140 <aaf1-0xec0>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf3's .iplt entry
+#------------------------------------------------------------------------------
+ a2f8: f7fe bf20 b\.w 913c <aaf1-0xec4>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf3's .iplt entry
+#------------------------------------------------------------------------------
+ a2fc: f43e af1e beq\.w 913c <aaf1-0xec4>
+ a300: 4c00 ldr r4, \[pc, #0\] ; \(a304 <_thumb\+0x100>\)
+ a302: 4c01 ldr r4, \[pc, #4\] ; \(a308 <_thumb\+0x104>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of ttf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a304: 0000005c \.word 0x0000005c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of ttf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a308: 00006d54 \.word 0x00006d54
+#------------------------------------------------------------------------------
+#------ abf3's .iplt entry
+#------------------------------------------------------------------------------
+ a30c: f7fe ef10 blx 9130 <aaf1-0xed0>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf3's .iplt entry
+#------------------------------------------------------------------------------
+ a310: f7fe bf0c b\.w 912c <aaf1-0xed4>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf3's .iplt entry
+#------------------------------------------------------------------------------
+ a314: f43e af0a beq\.w 912c <aaf1-0xed4>
+ a318: 4c00 ldr r4, \[pc, #0\] ; \(a31c <_thumb\+0x118>\)
+ a31a: 4c01 ldr r4, \[pc, #4\] ; \(a320 <_thumb\+0x11c>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of abf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a31c: 00000058 \.word 0x00000058
+#------------------------------------------------------------------------------
+#------ PC-relative offset of abf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a320: 00006d38 \.word 0x00006d38
+#------------------------------------------------------------------------------
+#------ tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ a324: f7fe ef14 blx 9150 <aaf1-0xeb0>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ a328: f7fe bf10 b\.w 914c <aaf1-0xeb4>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf3's .iplt entry
+#------------------------------------------------------------------------------
+ a32c: f43e af0e beq\.w 914c <aaf1-0xeb4>
+ a330: 4c00 ldr r4, \[pc, #0\] ; \(a334 <_thumb\+0x130>\)
+ a332: 4c01 ldr r4, \[pc, #4\] ; \(a338 <_thumb\+0x134>\)
+#------------------------------------------------------------------------------
+#------ GP-relative offset of tbf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a334: 00000060 \.word 0x00000060
+#------------------------------------------------------------------------------
+#------ PC-relative offset of tbf3's .igot.plt entry
+#------------------------------------------------------------------------------
+ a338: 00006d28 \.word 0x00006d28
+#------------------------------------------------------------------------------
+#------ atf4's .plt entry
+#------------------------------------------------------------------------------
+ a33c: f7fe eeae blx 909c <aaf1-0xf64>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf4's .plt entry
+#------------------------------------------------------------------------------
+ a340: f7fe beaa b\.w 9098 <aaf1-0xf68>
+#------------------------------------------------------------------------------
+#------ thumb entry to atf4's .plt entry
+#------------------------------------------------------------------------------
+ a344: f43e aea8 beq\.w 9098 <aaf1-0xf68>
+ a348: 4c00 ldr r4, \[pc, #0\] ; \(a34c <_thumb\+0x148>\)
+ a34a: 4c01 ldr r4, \[pc, #4\] ; \(a350 <_thumb\+0x14c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for atf4
+#------------------------------------------------------------------------------
+ a34c: 00000098 \.word 0x00000098
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for atf4
+#------------------------------------------------------------------------------
+ a350: 00006d48 \.word 0x00006d48
+#------------------------------------------------------------------------------
+#------ ttf4's .plt entry
+#------------------------------------------------------------------------------
+ a354: f7fe ee9a blx 908c <aaf1-0xf74>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf4's .plt entry
+#------------------------------------------------------------------------------
+ a358: f7fe be96 b\.w 9088 <aaf1-0xf78>
+#------------------------------------------------------------------------------
+#------ thumb entry to ttf4's .plt entry
+#------------------------------------------------------------------------------
+ a35c: f43e ae94 beq\.w 9088 <aaf1-0xf78>
+ a360: 4c00 ldr r4, \[pc, #0\] ; \(a364 <_thumb\+0x160>\)
+ a362: 4c01 ldr r4, \[pc, #4\] ; \(a368 <_thumb\+0x164>\)
+#------------------------------------------------------------------------------
+#------ .got offset for ttf4
+#------------------------------------------------------------------------------
+ a364: 00000094 \.word 0x00000094
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for ttf4
+#------------------------------------------------------------------------------
+ a368: 00006d2c \.word 0x00006d2c
+#------------------------------------------------------------------------------
+#------ abf4's .plt entry
+#------------------------------------------------------------------------------
+ a36c: f7fe ee7e blx 906c <aaf1-0xf94>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf4's .plt entry
+#------------------------------------------------------------------------------
+ a370: f7fe be7a b\.w 9068 <aaf1-0xf98>
+#------------------------------------------------------------------------------
+#------ thumb entry to abf4's .plt entry
+#------------------------------------------------------------------------------
+ a374: f43e ae78 beq\.w 9068 <aaf1-0xf98>
+ a378: 4c00 ldr r4, \[pc, #0\] ; \(a37c <_thumb\+0x178>\)
+ a37a: 4c01 ldr r4, \[pc, #4\] ; \(a380 <_thumb\+0x17c>\)
+#------------------------------------------------------------------------------
+#------ .got offset for abf4
+#------------------------------------------------------------------------------
+ a37c: 0000008c \.word 0x0000008c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for abf4
+#------------------------------------------------------------------------------
+ a380: 00006d0c \.word 0x00006d0c
+#------------------------------------------------------------------------------
+#------ tbf4's .plt entry
+#------------------------------------------------------------------------------
+ a384: f7fe ee7a blx 907c <aaf1-0xf84>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf4's .plt entry
+#------------------------------------------------------------------------------
+ a388: f7fe be76 b\.w 9078 <aaf1-0xf88>
+#------------------------------------------------------------------------------
+#------ thumb entry to tbf4's .plt entry
+#------------------------------------------------------------------------------
+ a38c: f43e ae74 beq\.w 9078 <aaf1-0xf88>
+ a390: 4c00 ldr r4, \[pc, #0\] ; \(a394 <_thumb\+0x190>\)
+ a392: 4c01 ldr r4, \[pc, #4\] ; \(a398 <_thumb\+0x194>\)
+#------------------------------------------------------------------------------
+#------ .got offset for tbf4
+#------------------------------------------------------------------------------
+ a394: 00000090 \.word 0x00000090
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for tbf4
+#------------------------------------------------------------------------------
+ a398: 00006cf8 \.word 0x00006cf8
diff --git a/ld/testsuite/ld-arm/ifunc-8.gd b/ld/testsuite/ld-arm/ifunc-8.gd
new file mode 100644
index 0000000000..7efefa0649
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-8.gd
@@ -0,0 +1,167 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------ 00010004: contains aaf1 [R_ARM_IRELATIVE]
+#------ 00010008: contains PC-relative offset of aaf1's .iplt entry
+#------ 0001000c: contains atf1 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10000 44332211 00a00000 bc90ffff 04a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010010: contains PC-relative offset of atf1's .iplt entry
+#------ 00010014: contains abf1 [R_ARM_IRELATIVE]
+#------ 00010018: contains PC-relative offset of abf1's .iplt entry
+#------ 0001001c: contains taf1 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10010 c490ffff 08a00000 cc90ffff 0da00000 .*
+#------------------------------------------------------------------------------
+#------ 00010020: contains PC-relative offset of taf1's .iplt entry
+#------ 00010024: contains ttf1 [R_ARM_IRELATIVE]
+#------ 00010028: contains PC-relative offset of ttf1's .iplt entry
+#------ 0001002c: contains tbf1 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10020 d090ffff 0fa00000 d890ffff 11a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010030: contains PC-relative offset of tbf1's .iplt entry
+#------ 00010034: aaf2 [R_ARM_ABS32]
+#------ 00010038: aaf2 [R_ARM_REL32]
+#------ 0001003c: atf2 [R_ARM_ABS32]
+#------------------------------------------------------------------------------
+ 10030 e090ffff 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00010040: atf2 [R_ARM_REL32]
+#------ 00010044: abf2 [R_ARM_ABS32]
+#------ 00010048: abf2 [R_ARM_REL32]
+#------ 0001004c: taf2 [R_ARM_ABS32]
+#------------------------------------------------------------------------------
+ 10040 00000000 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00010050: taf2 [R_ARM_REL32]
+#------ 00010054: ttf2 [R_ARM_ABS32]
+#------ 00010058: ttf2 [R_ARM_REL32]
+#------ 0001005c: tbf2 [R_ARM_ABS32]
+#------------------------------------------------------------------------------
+ 10050 00000000 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00010060: tbf2 [R_ARM_REL32]
+#------ 00010064: contains aaf3 [R_ARM_IRELATIVE]
+#------ 00010068: contains PC-relative offset of aaf3's .iplt entry
+#------ 0001006c: contains atf3 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10060 00000000 14a00000 0091ffff 18a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010070: contains PC-relative offset of atf3's .iplt entry
+#------ 00010074: contains abf3 [R_ARM_IRELATIVE]
+#------ 00010078: contains PC-relative offset of abf3's .iplt entry
+#------ 0001007c: contains taf3 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10070 b090ffff 1ca00000 b890ffff 21a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010080: contains PC-relative offset of taf3's .iplt entry
+#------ 00010084: contains ttf3 [R_ARM_IRELATIVE]
+#------ 00010088: contains PC-relative offset of ttf3's .iplt entry
+#------ 0001008c: contains tbf3 [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 10080 dc90ffff 23a00000 b890ffff 25a00000 .*
+#------------------------------------------------------------------------------
+#------ 00010090: contains PC-relative offset of tbf3's .iplt entry
+#------ 00010094: aaf4 [R_ARM_ABS32]
+#------ 00010098: aaf4 [R_ARM_REL32]
+#------ 0001009c: atf4 [R_ARM_ABS32]
+#------------------------------------------------------------------------------
+ 10090 c090ffff 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 000100a0: atf4 [R_ARM_REL32]
+#------ 000100a4: abf4 [R_ARM_ABS32]
+#------ 000100a8: abf4 [R_ARM_REL32]
+#------ 000100ac: taf4 [R_ARM_ABS32]
+#------------------------------------------------------------------------------
+ 100a0 00000000 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 000100b0: taf4 [R_ARM_REL32]
+#------ 000100b4: ttf4 [R_ARM_ABS32]
+#------ 000100b8: ttf4 [R_ARM_REL32]
+#------ 000100bc: tbf4 [R_ARM_ABS32]
+#------------------------------------------------------------------------------
+ 100b0 00000000 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 000100c0: tbf4 [R_ARM_REL32]
+#------------------------------------------------------------------------------
+ 100c0 00000000 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: atf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11000 00200100 00000000 00000000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: aaf4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011014: ttf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011018: tbf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 0001101c: taf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11010 00900000 00900000 00900000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011020: aaf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011024: abf4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011028: tbf4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 0001102c: ttf4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11020 00900000 00900000 00900000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011030: atf4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011034: taf4's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 00011038: abf2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------ 0001103c: aaf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11030 00900000 00900000 00900000 00a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011040: atf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011044: abf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011048: taf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001104c: ttf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11040 04a00000 08a00000 0da00000 0fa00000 .*
+#------------------------------------------------------------------------------
+#------ 00011050: tbf1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011054: atf3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011058: abf3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001105c: ttf3's .igot.plt entry [R_ARM_IRELATIVE]
+#------------------------------------------------------------------------------
+ 11050 11a00000 18a00000 1ca00000 23a00000 .*
+#------------------------------------------------------------------------------
+#------ 00011060: tbf3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011064: taf3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011068: aaf3's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 0001106c: .got entry for foo [R_ARM_RELATIVE]
+#------------------------------------------------------------------------------
+ 11060 25a00000 21a00000 14a00000 00000100 .*
+#------------------------------------------------------------------------------
+#------ 00011070: .got entry for foo [R_ARM_RELATIVE]
+#------ 00011074: .got entry for atf2 [R_ARM_GLOB_DAT]
+#------ 00011078: .got entry for aaf4 [R_ARM_GLOB_DAT]
+#------ 0001107c: .got entry for ttf2 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 11070 00000100 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00011080: .got entry for tbf2 [R_ARM_GLOB_DAT]
+#------ 00011084: .got entry for taf2 [R_ARM_GLOB_DAT]
+#------ 00011088: .got entry for aaf2 [R_ARM_GLOB_DAT]
+#------ 0001108c: .got entry for abf4 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 11080 00000000 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 00011090: .got entry for tbf4 [R_ARM_GLOB_DAT]
+#------ 00011094: .got entry for ttf4 [R_ARM_GLOB_DAT]
+#------ 00011098: .got entry for atf4 [R_ARM_GLOB_DAT]
+#------ 0001109c: .got entry for taf4 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 11090 00000000 00000000 00000000 00000000 .*
+#------------------------------------------------------------------------------
+#------ 000110a0: .got entry for abf2 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 110a0 00000000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-8.rd b/ld/testsuite/ld-arm/ifunc-8.rd
new file mode 100644
index 0000000000..a8ad1f2996
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-8.rd
@@ -0,0 +1,80 @@
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 62 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001106c ......17 R_ARM_RELATIVE
+00011070 ......17 R_ARM_RELATIVE
+00010004 ......a0 R_ARM_IRELATIVE
+0001000c ......a0 R_ARM_IRELATIVE
+00010014 ......a0 R_ARM_IRELATIVE
+0001001c ......a0 R_ARM_IRELATIVE
+00010024 ......a0 R_ARM_IRELATIVE
+0001002c ......a0 R_ARM_IRELATIVE
+00010064 ......a0 R_ARM_IRELATIVE
+0001006c ......a0 R_ARM_IRELATIVE
+00010074 ......a0 R_ARM_IRELATIVE
+0001007c ......a0 R_ARM_IRELATIVE
+00010084 ......a0 R_ARM_IRELATIVE
+0001008c ......a0 R_ARM_IRELATIVE
+0001103c ......a0 R_ARM_IRELATIVE
+00011040 ......a0 R_ARM_IRELATIVE
+00011044 ......a0 R_ARM_IRELATIVE
+00011048 ......a0 R_ARM_IRELATIVE
+0001104c ......a0 R_ARM_IRELATIVE
+00011050 ......a0 R_ARM_IRELATIVE
+00011054 ......a0 R_ARM_IRELATIVE
+00011058 ......a0 R_ARM_IRELATIVE
+0001105c ......a0 R_ARM_IRELATIVE
+00011060 ......a0 R_ARM_IRELATIVE
+00011064 ......a0 R_ARM_IRELATIVE
+00011068 ......a0 R_ARM_IRELATIVE
+00010034 ......02 R_ARM_ABS32 00000000 aaf2
+00010038 ......03 R_ARM_REL32 00000000 aaf2
+00011088 ......15 R_ARM_GLOB_DAT 00000000 aaf2
+0001003c ......02 R_ARM_ABS32 00000000 atf2
+00010040 ......03 R_ARM_REL32 00000000 atf2
+00011074 ......15 R_ARM_GLOB_DAT 00000000 atf2
+00010044 ......02 R_ARM_ABS32 00000000 abf2
+00010048 ......03 R_ARM_REL32 00000000 abf2
+000110a0 ......15 R_ARM_GLOB_DAT 00000000 abf2
+0001004c ......02 R_ARM_ABS32 00000000 taf2
+00010050 ......03 R_ARM_REL32 00000000 taf2
+00011084 ......15 R_ARM_GLOB_DAT 00000000 taf2
+00010054 ......02 R_ARM_ABS32 00000000 ttf2
+00010058 ......03 R_ARM_REL32 00000000 ttf2
+0001107c ......15 R_ARM_GLOB_DAT 00000000 ttf2
+0001005c ......02 R_ARM_ABS32 00000000 tbf2
+00010060 ......03 R_ARM_REL32 00000000 tbf2
+00011080 ......15 R_ARM_GLOB_DAT 00000000 tbf2
+00010094 ......02 R_ARM_ABS32 00000000 aaf4
+00010098 ......03 R_ARM_REL32 00000000 aaf4
+00011078 ......15 R_ARM_GLOB_DAT 00000000 aaf4
+0001009c ......02 R_ARM_ABS32 00000000 atf4
+000100a0 ......03 R_ARM_REL32 00000000 atf4
+00011098 ......15 R_ARM_GLOB_DAT 00000000 atf4
+000100a4 ......02 R_ARM_ABS32 00000000 abf4
+000100a8 ......03 R_ARM_REL32 00000000 abf4
+0001108c ......15 R_ARM_GLOB_DAT 00000000 abf4
+000100ac ......02 R_ARM_ABS32 00000000 taf4
+000100b0 ......03 R_ARM_REL32 00000000 taf4
+0001109c ......15 R_ARM_GLOB_DAT 00000000 taf4
+000100b4 ......02 R_ARM_ABS32 00000000 ttf4
+000100b8 ......03 R_ARM_REL32 00000000 ttf4
+00011094 ......15 R_ARM_GLOB_DAT 00000000 ttf4
+000100bc ......02 R_ARM_ABS32 00000000 tbf4
+000100c0 ......03 R_ARM_REL32 00000000 tbf4
+00011090 ......15 R_ARM_GLOB_DAT 00000000 tbf4
+
+Relocation section '\.rel\.plt' at offset 0x81f0 contains 12 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......16 R_ARM_JUMP_SLOT 00000000 atf2
+00011010 ......16 R_ARM_JUMP_SLOT 00000000 aaf4
+00011014 ......16 R_ARM_JUMP_SLOT 00000000 ttf2
+00011018 ......16 R_ARM_JUMP_SLOT 00000000 tbf2
+0001101c ......16 R_ARM_JUMP_SLOT 00000000 taf2
+00011020 ......16 R_ARM_JUMP_SLOT 00000000 aaf2
+00011024 ......16 R_ARM_JUMP_SLOT 00000000 abf4
+00011028 ......16 R_ARM_JUMP_SLOT 00000000 tbf4
+0001102c ......16 R_ARM_JUMP_SLOT 00000000 ttf4
+00011030 ......16 R_ARM_JUMP_SLOT 00000000 atf4
+00011034 ......16 R_ARM_JUMP_SLOT 00000000 taf4
+00011038 ......16 R_ARM_JUMP_SLOT 00000000 abf2
diff --git a/ld/testsuite/ld-arm/ifunc-8.s b/ld/testsuite/ld-arm/ifunc-8.s
new file mode 100644
index 0000000000..3947f7f7e1
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-8.s
@@ -0,0 +1,88 @@
+ .syntax unified
+ .arch armv6t2
+
+ .macro define,name,type
+ .type \name,%gnu_indirect_function
+ \type
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro define2,name
+ define aa\name,.arm
+ define at\name,.arm
+ define ab\name,.arm
+ define ta\name,.thumb_func
+ define tt\name,.thumb_func
+ define tb\name,.thumb_func
+ .endm
+
+ .macro test_relocs,name,width
+ bl \name(PLT)
+ b\width \name
+ beq\width \name
+ ldr r4,1f
+ ldr r4,2f
+1:
+ .word \name(GOT)
+2:
+ .word \name(GOT_PREL)
+ .endm
+
+ .macro test_relocs2,name,type,width
+ test_relocs a\type\name,\width
+ test_relocs t\type\name,\width
+ test_relocs ab\name,\width
+ test_relocs tb\name,\width
+ .endm
+
+ .macro diff,name
+ .word \name
+ .word \name-.
+ .endm
+
+ .macro alldirs,doit,name
+ \doit aa\name
+ \doit at\name
+ \doit ab\name
+ \doit ta\name
+ \doit tt\name
+ \doit tb\name
+ .endm
+
+ define2 f1
+ define2 f3
+
+ alldirs .globl,f3
+ alldirs .hidden,f3
+
+ .globl arm
+ .type arm,%function
+ .arm
+arm:
+ test_relocs foo
+ test_relocs2 f1,a,
+ test_relocs2 f2,a,
+ test_relocs2 f3,a,
+ test_relocs2 f4,a,
+ .size arm,.-arm
+
+ .globl _thumb
+ .type _thumb,%function
+ .thumb_func
+_thumb:
+ test_relocs foo
+ test_relocs2 f1,t,.w
+ test_relocs2 f2,t,.w
+ test_relocs2 f3,t,.w
+ test_relocs2 f4,t,.w
+ .size _thumb,.-_thumb
+
+ .data
+foo:
+ .word 0x11223344
+ alldirs diff,f1
+ alldirs diff,f2
+ alldirs diff,f3
+ alldirs diff,f4
diff --git a/ld/testsuite/ld-arm/ifunc-9.dd b/ld/testsuite/ld-arm/ifunc-9.dd
new file mode 100644
index 0000000000..be8f3d04f4
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-9.dd
@@ -0,0 +1,154 @@
+
+.*
+
+
+Disassembly of section \.plt:
+
+00009000 <\.plt>:
+ 9000: e52de004 push {lr} ; \(str lr, \[sp, #-4\]!\)
+ 9004: e59fe004 ldr lr, \[pc, #4\] ; 9010 <f3-0x1c>
+ 9008: e08fe00e add lr, pc, lr
+ 900c: e5bef008 ldr pc, \[lr, #8\]!
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got.plt
+#------------------------------------------------------------------------------
+ 9010: 00007ff0 \.word 0x00007ff0
+#------------------------------------------------------------------------------
+#------ f2's .plt entry
+#------------------------------------------------------------------------------
+ 9014: e28fc600 add ip, pc, #0
+ 9018: e28cca07 add ip, ip, #28672 ; 0x7000
+ 901c: e5bcfff0 ldr pc, \[ip, #4080\]! ; 0xff0
+
+Disassembly of section \.iplt:
+
+00009020 <f3-0xc>:
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ 9020: e28fc600 add ip, pc, #0
+ 9024: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9028: e5bcffe8 ldr pc, \[ip, #4072\]! ; 0xfe8
+
+0000902c <f3>:
+ 902c: e28fc600 add ip, pc, #0
+ 9030: e28cca07 add ip, ip, #28672 ; 0x7000
+ 9034: e5bcffe0 ldr pc, \[ip, #4064\]! ; 0xfe0
+
+Disassembly of section \.text:
+
+0000a000 <f1>:
+ a000: e1a0f00e mov pc, lr
+ a004: e1a0f00e mov pc, lr
+
+0000a008 <_start>:
+ a008: eb0017fc bl 10000 <foo>
+ a00c: e59f400c ldr r4, \[pc, #12\] ; a020 <_start\+0x18>
+ a010: e59f400c ldr r4, \[pc, #12\] ; a024 <_start\+0x1c>
+ a014: e59f400c ldr r4, \[pc, #12\] ; a028 <_start\+0x20>
+ a018: e59f400c ldr r4, \[pc, #12\] ; a02c <_start\+0x24>
+ a01c: e59f500c ldr r5, \[pc, #12\] ; a030 <_start\+0x28>
+#------------------------------------------------------------------------------
+#------ foo
+#------------------------------------------------------------------------------
+ a020: 00010000 \.word 0x00010000
+#------------------------------------------------------------------------------
+#------ PC-relative offset of foo
+#------------------------------------------------------------------------------
+ a024: 00005fdc \.word 0x00005fdc
+#------------------------------------------------------------------------------
+#------ GP-relative offset of foo
+#------------------------------------------------------------------------------
+ a028: fffff000 \.word 0xfffff000
+#------------------------------------------------------------------------------
+#------ .got offset for foo
+#------------------------------------------------------------------------------
+ a02c: 00000020 \.word 0x00000020
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for foo
+#------------------------------------------------------------------------------
+ a030: 00006fe8 \.word 0x00006fe8
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a034: ebfffbf9 bl 9020 <f3-0xc>
+ a038: e59f400c ldr r4, \[pc, #12\] ; a04c <_start\+0x44>
+ a03c: e59f400c ldr r4, \[pc, #12\] ; a050 <_start\+0x48>
+ a040: e59f400c ldr r4, \[pc, #12\] ; a054 <_start\+0x4c>
+ a044: e59f400c ldr r4, \[pc, #12\] ; a058 <_start\+0x50>
+ a048: e59f500c ldr r5, \[pc, #12\] ; a05c <_start\+0x54>
+#------------------------------------------------------------------------------
+#------ f1's .iplt entry
+#------------------------------------------------------------------------------
+ a04c: 00009020 \.word 0x00009020
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f1's .iplt entry
+#------------------------------------------------------------------------------
+ a050: ffffefd0 \.word 0xffffefd0
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f1's .iplt entry
+#------------------------------------------------------------------------------
+ a054: ffff8020 \.word 0xffff8020
+#------------------------------------------------------------------------------
+#------ .got offset for f1's .iplt entry
+#------------------------------------------------------------------------------
+ a058: 0000001c \.word 0x0000001c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f1's .iplt entry
+#------------------------------------------------------------------------------
+ a05c: 00006fc0 \.word 0x00006fc0
+#------------------------------------------------------------------------------
+#------ f2's .plt entry
+#------------------------------------------------------------------------------
+ a060: ebfffbeb bl 9014 <f3-0x18>
+ a064: e59f400c ldr r4, \[pc, #12\] ; a078 <_start\+0x70>
+ a068: e59f400c ldr r4, \[pc, #12\] ; a07c <_start\+0x74>
+ a06c: e59f400c ldr r4, \[pc, #12\] ; a080 <_start\+0x78>
+ a070: e59f400c ldr r4, \[pc, #12\] ; a084 <_start\+0x7c>
+ a074: e59f500c ldr r5, \[pc, #12\] ; a088 <_start\+0x80>
+#------------------------------------------------------------------------------
+#------ f2's .plt entry
+#------------------------------------------------------------------------------
+ a078: 00009014 \.word 0x00009014
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f2's .plt entry
+#------------------------------------------------------------------------------
+ a07c: ffffef98 \.word 0xffffef98
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f2's .plt entry
+#------------------------------------------------------------------------------
+ a080: ffff8014 \.word 0xffff8014
+#------------------------------------------------------------------------------
+#------ .got offset for f2
+#------------------------------------------------------------------------------
+ a084: 00000028 \.word 0x00000028
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f2
+#------------------------------------------------------------------------------
+ a088: 00006fa0 \.word 0x00006fa0
+ a08c: ebfffbe6 bl 902c <f3>
+ a090: e59f400c ldr r4, \[pc, #12\] ; a0a4 <_start\+0x9c>
+ a094: e59f400c ldr r4, \[pc, #12\] ; a0a8 <_start\+0xa0>
+ a098: e59f400c ldr r4, \[pc, #12\] ; a0ac <_start\+0xa4>
+ a09c: e59f400c ldr r4, \[pc, #12\] ; a0b0 <_start\+0xa8>
+ a0a0: e59f500c ldr r5, \[pc, #12\] ; a0b4 <_start\+0xac>
+#------------------------------------------------------------------------------
+#------ f3
+#------------------------------------------------------------------------------
+ a0a4: 0000902c \.word 0x0000902c
+#------------------------------------------------------------------------------
+#------ PC-relative offset of f3
+#------------------------------------------------------------------------------
+ a0a8: ffffef84 \.word 0xffffef84
+#------------------------------------------------------------------------------
+#------ GP-relative offset of f3
+#------------------------------------------------------------------------------
+ a0ac: ffff802c \.word 0xffff802c
+#------------------------------------------------------------------------------
+#------ .got offset for f3
+#------------------------------------------------------------------------------
+ a0b0: 00000024 \.word 0x00000024
+#------------------------------------------------------------------------------
+#------ PC-relative offset of .got entry for f3
+#------------------------------------------------------------------------------
+ a0b4: 00006f70 \.word 0x00006f70
diff --git a/ld/testsuite/ld-arm/ifunc-9.gd b/ld/testsuite/ld-arm/ifunc-9.gd
new file mode 100644
index 0000000000..6f220d1c26
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-9.gd
@@ -0,0 +1,29 @@
+
+.*
+
+Contents of section \.data:
+#------------------------------------------------------------------------------
+#------ 00010000: foo
+#------------------------------------------------------------------------------
+ 10000 44332211 .*
+Contents of section \.got:
+#------------------------------------------------------------------------------
+#------ 00011000: .got.plt
+#------ 00011004: reserved .got.plt entry
+#------ 00011008: reserved .got.plt entry
+#------ 0001100c: f2's .got.plt entry [R_ARM_JUMP_SLOT]
+#------------------------------------------------------------------------------
+ 11000 00200100 00000000 00000000 00900000 .*
+#------------------------------------------------------------------------------
+#------ 00011010: f1's .igot.plt entry [R_ARM_IRELATIVE]
+#------ 00011014: f3's .igot.plt pointer to 0xa004 [R_ARM_IRELATIVE]
+#------ 00011018: .got entry for foo
+#------ 0001101c: .got entry for f1's .iplt entry
+#------------------------------------------------------------------------------
+ 11010 00a00000 04a00000 00000100 20900000 .*
+#------------------------------------------------------------------------------
+#------ 00011020: .got entry for foo
+#------ 00011024: .got entry for f3
+#------ 00011028: .got entry for f2 [R_ARM_GLOB_DAT]
+#------------------------------------------------------------------------------
+ 11020 00000100 2c900000 00000000 .*
diff --git a/ld/testsuite/ld-arm/ifunc-9.rd b/ld/testsuite/ld-arm/ifunc-9.rd
new file mode 100644
index 0000000000..689f6639c5
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-9.rd
@@ -0,0 +1,10 @@
+
+Relocation section '\.rel\.dyn' at offset 0x8000 contains 3 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+00011010 ......a0 R_ARM_IRELATIVE
+00011014 ......a0 R_ARM_IRELATIVE
+00011028 ......15 R_ARM_GLOB_DAT 00009014 f2
+
+Relocation section '\.rel\.plt' at offset 0x8018 contains 1 entries:
+ Offset Info Type Sym\.Value Sym\. Name
+0001100c ......16 R_ARM_JUMP_SLOT 00009014 f2
diff --git a/ld/testsuite/ld-arm/ifunc-9.s b/ld/testsuite/ld-arm/ifunc-9.s
new file mode 100644
index 0000000000..25b682f962
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-9.s
@@ -0,0 +1,44 @@
+ .macro define,name
+ .type \name,%gnu_indirect_function
+\name:
+ mov pc,lr
+ .size \name,.-\name
+ .endm
+
+ .macro test_relocs,name
+ bl \name
+ ldr r4,1f
+ ldr r4,2f
+ ldr r4,3f
+ ldr r4,4f
+ ldr r5,5f
+1:
+ .word \name
+2:
+ .word \name-.
+3:
+ .word \name(GOTOFF)
+4:
+ .word \name(GOT)
+5:
+ .word \name(GOT_PREL)
+ .endm
+
+ .global f3
+ .hidden f3
+
+ define f1
+ # f2 provided by ifunc-3.so
+ define f3
+
+ .globl _start
+_start:
+ test_relocs foo
+ test_relocs f1
+ test_relocs f2
+ test_relocs f3
+ .size _start,.-_start
+
+ .data
+foo:
+ .word 0x11223344
diff --git a/ld/testsuite/ld-arm/ifunc-dynamic.ld b/ld/testsuite/ld-arm/ifunc-dynamic.ld
new file mode 100644
index 0000000000..1e030d806b
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-dynamic.ld
@@ -0,0 +1,33 @@
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+ . = 0x07000;
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ . = 0x08000;
+ .rel.dyn : {
+ *(.rel.dyn)
+ *(.rel.data)
+ *(.rel.got)
+ PROVIDE_HIDDEN (__irel_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__irel_end = .);
+ }
+ .rel.plt : { *(.rel.plt) }
+ . = 0x09000;
+ .plt : { *(.plt) }
+ .iplt : { *(.iplt) }
+ . = 0x0A000;
+ .text : { *(.text) }
+ . = 0x10000;
+ .data : { *(.data) }
+ . = 0x11000;
+ .got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
+ . = 0x12000;
+ .dynamic : { *(.dynamic) }
+ . = 0x13000;
+ .bss : { *(.bss) }
+}
diff --git a/ld/testsuite/ld-arm/ifunc-static.ld b/ld/testsuite/ld-arm/ifunc-static.ld
new file mode 100644
index 0000000000..80cf6a2a05
--- /dev/null
+++ b/ld/testsuite/ld-arm/ifunc-static.ld
@@ -0,0 +1,21 @@
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+ . = 0x08000;
+ .rel.dyn : {
+ PROVIDE_HIDDEN (__irel_start = .);
+ *(.rel.iplt)
+ PROVIDE_HIDDEN (__irel_end = .);
+ }
+ . = 0x09000;
+ .iplt : { *(.iplt) }
+ . = 0x0A000;
+ .text : { *(.text) }
+ . = 0x10000;
+ .data : { *(.data) }
+ . = 0x11000;
+ .got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
+ . = 0x12000;
+ .bss : { *(.bss) }
+}