binutils-gdb/ld/testsuite/ld-arm
Christophe Lyon a77ccc8129 arm: Handle undefweak with ST_BRANCH_UNKNOWN
A previous patch made ld fail early on Thumb-only where branch_type is
ST_BRANCH_UNKNOWN.

However, this fails erroneously when the target is undefweak: in that
case the branch should be replaced by a branch to the next instruction
(or nop.w on thumb2).  This patch accepts this case and restores the
previous behaviour in such cases.

This was reported by failures in the GCC testsuite, where we fail to
link executables because __deregister_frame_info is undefweak:

(__deregister_frame_info): Unknown destination type (ARM/Thumb) in ...crtbegin.o
crtbegin.o: in function `__do_global_dtors_aux':
crtstuff.c:(.text+0x52): dangerous relocation: unsupported relocation
2024-09-11 15:34:32 +00:00
..
abs-call-1.d
abs-call-1.s
arch-v6.s
arch-v6k.s
arch-v6t2.s
arm_purecode.ld
arm-app-abs32.d
arm-app-abs32.r
arm-app-abs32.s
arm-app-movw.s
arm-app.d
arm-app.r
arm-app.s
arm-be8.d
arm-be8.s
arm-call1.s
arm-call2.s
arm-call.d
arm-dyn.ld
arm-elf.exp arm: Handle undefweak with ST_BRANCH_UNKNOWN 2024-09-11 15:34:32 +00:00
arm-export-class.rd
arm-export-class.xd
arm-lib-plt32.d
arm-lib-plt32.r
arm-lib-plt32.s
arm-lib-plt-2.dd
arm-lib-plt-2.rd
arm-lib-plt-2a.s
arm-lib-plt-2b.s
arm-lib.d
arm-lib.ld
arm-lib.r
arm-lib.s
arm-movwt.d
arm-movwt.s
arm-no-rel-plt.ld
arm-no-rel-plt.r
arm-pic-veneer.d
arm-pic-veneer.s
arm-rel31.d
arm-rel31.s
arm-rel32.d
arm-rel32.s
arm-static-app.d
arm-static-app.r
arm-static-app.s
arm-target1-abs.d
arm-target1-rel.d
arm-target1.s
arm-target2-abs.d
arm-target2-got-rel.d
arm-target2-rel.d
arm-target2.s
arm.ld
armthumb-lib.d
armthumb-lib.sym
armv4-bx.d
armv4-bx.s
attr-merge-2.attr
attr-merge-2a.s
attr-merge-2b.s
attr-merge-3.attr
attr-merge-3a.s
attr-merge-3b.s
attr-merge-4.attr
attr-merge-4a.s
attr-merge-4b.s
attr-merge-5.attr
attr-merge-5.s
attr-merge-6.attr
attr-merge-6a.s
attr-merge-6b.s
attr-merge-7.attr
attr-merge-7a.s
attr-merge-7b.s
attr-merge-8.attr
attr-merge-8a.s
attr-merge-8b.s
attr-merge-9.out
attr-merge-9a.s
attr-merge-9b.s
attr-merge-10-dsp.attr
attr-merge-10.attr
attr-merge-10a.s
attr-merge-10b-dsp.s
attr-merge-10b.s
attr-merge-11.attr
attr-merge-11a.s
attr-merge-11b.s
attr-merge-12.attr
attr-merge-12a.s
attr-merge-12b.s
attr-merge-13.attr
attr-merge-13a.s
attr-merge-13b.s
attr-merge-arch-1.attr
attr-merge-arch-2.attr
attr-merge-arch-2.d
attr-merge-arch-2a.s
attr-merge-arch-2b.s arm: Do not insert stubs needing Arm code on Thumb-only cores. 2024-09-04 13:35:10 +00:00
attr-merge-div-0.s
attr-merge-div-1.s
attr-merge-div-2.s
attr-merge-div-00.d
attr-merge-div-01-m3.d
attr-merge-div-01.d
attr-merge-div-02.d
attr-merge-div-10-m3.d
attr-merge-div-10.d
attr-merge-div-11.d
attr-merge-div-12.d
attr-merge-div-20.d
attr-merge-div-21.d
attr-merge-div-22.d
attr-merge-div-120.d
attr-merge-hardfp-use-1.d
attr-merge-hardfp-use-1a.s
attr-merge-hardfp-use-1b.s
attr-merge-hardfp-use-2.d
attr-merge-hardfp-use-2a.s
attr-merge-hardfp-use-2b.s
attr-merge-incompatible.d
attr-merge-incompatiblea.s
attr-merge-incompatibleb.s
attr-merge-nosection-1.d
attr-merge-nosection-1a.s
attr-merge-nosection-1b.s
attr-merge-unknown-1.d
attr-merge-unknown-1.s
attr-merge-unknown-2.d
attr-merge-unknown-2.s
attr-merge-unknown-2r.d
attr-merge-unknown-3.d
attr-merge-vfp-1.d
attr-merge-vfp-1r.d
attr-merge-vfp-2.d
attr-merge-vfp-2.s
attr-merge-vfp-2r.d
attr-merge-vfp-3-d16.s
attr-merge-vfp-3.d
attr-merge-vfp-3.s
attr-merge-vfp-3r.d
attr-merge-vfp-4-d16.s
attr-merge-vfp-4-sp.s
attr-merge-vfp-4.d
attr-merge-vfp-4.s
attr-merge-vfp-4r.d
attr-merge-vfp-5-sp.s
attr-merge-vfp-5.d
attr-merge-vfp-5.s
attr-merge-vfp-5r.d
attr-merge-vfp-6.d
attr-merge-vfp-6r.d
attr-merge-vfp-7.d
attr-merge-vfp-7r.d
attr-merge-vfp-8.d
attr-merge-vfp-8r.d
attr-merge-vfp-9.d
attr-merge-vfp-9r.d
attr-merge-vfp-10.d
attr-merge-vfp-10r.d
attr-merge-vfp-11.d
attr-merge-vfp-11r.d
attr-merge-vfp-12.d
attr-merge-vfp-12r.d
attr-merge-vfp-13.d
attr-merge-vfp-13r.d
attr-merge-vfp-14.d
attr-merge-vfp-14r.d
attr-merge-vfp-armv8-hard.s
attr-merge-vfp-armv8.s
attr-merge-vfpv3xd.s
attr-merge-wchar-0.s
attr-merge-wchar-2.s
attr-merge-wchar-4.s
attr-merge-wchar-00-nowarn.d
attr-merge-wchar-00.d
attr-merge-wchar-02-nowarn.d
attr-merge-wchar-02.d
attr-merge-wchar-04-nowarn.d
attr-merge-wchar-04.d
attr-merge-wchar-20-nowarn.d
attr-merge-wchar-20.d
attr-merge-wchar-22-nowarn.d
attr-merge-wchar-22.d
attr-merge-wchar-24-nowarn.d
attr-merge-wchar-24.d
attr-merge-wchar-40-nowarn.d
attr-merge-wchar-40.d
attr-merge-wchar-42-nowarn.d
attr-merge-wchar-42.d
attr-merge-wchar-44-nowarn.d
attr-merge-wchar-44.d
attr-merge.attr
attr-merge.s
bf.d
bf.s
bfcsel.d
bfcsel.s
bfl.d
bfl.s
bfs-0.s
bfs-1.s arm: Do not insert stubs needing Arm code on Thumb-only cores. 2024-09-04 13:35:10 +00:00
blank.s
branch-futures.d arm: Do not insert stubs needing Arm code on Thumb-only cores. 2024-09-04 13:35:10 +00:00
branch-lks-sym.ld
callweak-2.d
callweak-2.s
callweak.d
callweak.s
cmse_main_sec_debug.d
cmse_main.s
cmse_sec_debug.s
cmse-implib-errors.out
cmse-implib.rd
cmse-implib.s
cmse-implib.type
cmse-new-comeback-implib.rd
cmse-new-earlier-later-implib.out
cmse-new-implib-no-output.out
cmse-new-implib-not-sg-in-implib.out
cmse-new-implib.out
cmse-new-implib.rd
cmse-new-wrong-implib.out
cmse-veneers-no-gnu_sgstubs.out
cmse-veneers-wrong-entryfct.out
cmse-veneers.d
cmse-veneers.rd
cmse-veneers.s
cmse-veneers.sd
cortex-a8-arm-target.s
cortex-a8-far-1.s
cortex-a8-far-2.s
cortex-a8-far-3.s
cortex-a8-far.d
cortex-a8-fix-b-plt.d
cortex-a8-fix-b-plt.s
cortex-a8-fix-b-rel-arm.d
cortex-a8-fix-b-rel-thumb.d
cortex-a8-fix-b-rel.s
cortex-a8-fix-b.d
cortex-a8-fix-b.s
cortex-a8-fix-bcc-plt.d
cortex-a8-fix-bcc-plt.s
cortex-a8-fix-bcc-rel-thumb.d
cortex-a8-fix-bcc-rel.s
cortex-a8-fix-bcc.d
cortex-a8-fix-bcc.s
cortex-a8-fix-bl-plt.d
cortex-a8-fix-bl-plt.s
cortex-a8-fix-bl-rel-arm.d
cortex-a8-fix-bl-rel-plt.d
cortex-a8-fix-bl-rel-thumb.d
cortex-a8-fix-bl-rel.s
cortex-a8-fix-bl.d
cortex-a8-fix-bl.s
cortex-a8-fix-blx-bcond.d
cortex-a8-fix-blx-bcond.s
cortex-a8-fix-blx-plt.d
cortex-a8-fix-blx-plt.s
cortex-a8-fix-blx-rel-arm.d
cortex-a8-fix-blx-rel-thumb.d
cortex-a8-fix-blx-rel.s
cortex-a8-fix-blx.d
cortex-a8-fix-blx.s
cortex-a8-fix-hdr.d
cortex-a8-fix-hdr.s
cortex-a8-fix-hdr.t
cortex-a8-fix-plt.ld
cortex-a8-thumb-target.s
data-only-map.d
data-only-map.ld
data-only-map.s
discard-unwind.ld
eabi-hard-float.d
eabi-hard-float.s
eabi-soft-float-ABI4.d
eabi-soft-float-r.d
eabi-soft-float.d
eabi-soft-float.s
emit-relocs1-vxworks.d
emit-relocs1.d
emit-relocs1.s
exec-got-1.d
exec-got-1a.s
exec-got-1b.s
export-class.exp
farcall-arm-arm-pic-veneer.d
farcall-arm-arm.d
farcall-arm-arm.s
farcall-arm-nacl-pic.d
farcall-arm-nacl.d
farcall-arm-thumb-blx-pic-veneer.d
farcall-arm-thumb-blx.d
farcall-arm-thumb-pic-veneer.d
farcall-arm-thumb.d
farcall-arm-thumb.s
farcall-cond-thumb-arm.d
farcall-cond-thumb-arm.s
farcall-data-nacl.d
farcall-data.d
farcall-data.s
farcall-group2.s
farcall-group3.s
farcall-group4.s
farcall-group-limit.d
farcall-group-size2.d
farcall-group.d
farcall-group.s
farcall-missing-type-bad.s arm: Do not insert stubs needing Arm code on Thumb-only cores. 2024-09-04 13:35:10 +00:00
farcall-missing-type-main-undefweak.s arm: Handle undefweak with ST_BRANCH_UNKNOWN 2024-09-11 15:34:32 +00:00
farcall-missing-type-main.s arm: Do not insert stubs needing Arm code on Thumb-only cores. 2024-09-04 13:35:10 +00:00
farcall-missing-type-undefweak.d arm: Handle undefweak with ST_BRANCH_UNKNOWN 2024-09-11 15:34:32 +00:00
farcall-missing-type.d arm: Do not insert stubs needing Arm code on Thumb-only cores. 2024-09-04 13:35:10 +00:00
farcall-missing-type.ld arm: Do not insert stubs needing Arm code on Thumb-only cores. 2024-09-04 13:35:10 +00:00
farcall-mix2.d
farcall-mix2.s
farcall-mix.d
farcall-mix.s
farcall-mixed-app2.d
farcall-mixed-app2.r
farcall-mixed-app2.s
farcall-mixed-app2.sym
farcall-mixed-app-v5.d
farcall-mixed-app.d
farcall-mixed-app.r
farcall-mixed-app.s
farcall-mixed-app.sym
farcall-mixed-lib1.s
farcall-mixed-lib2.s
farcall-mixed-lib-v4t.d
farcall-mixed-lib.d
farcall-mixed-lib.r
farcall-section.d
farcall-section.s
farcall-thumb2-purecode.d
farcall-thumb2-purecode.s
farcall-thumb2-thumb2-m.d
farcall-thumb-arm-blx-pic-veneer.d
farcall-thumb-arm-blx.d
farcall-thumb-arm-pic-veneer.d
farcall-thumb-arm-short.d
farcall-thumb-arm-short.s
farcall-thumb-arm.d
farcall-thumb-arm.s
farcall-thumb-thumb-blx-pic-veneer.d
farcall-thumb-thumb-blx.d
farcall-thumb-thumb-m-no-profile-a.s
farcall-thumb-thumb-m-no-profile-b.s
farcall-thumb-thumb-m-no-profile.d
farcall-thumb-thumb-m-pic-veneer.d
farcall-thumb-thumb-m.d
farcall-thumb-thumb-pic-veneer.d
farcall-thumb-thumb.d
farcall-thumb-thumb.s
fdpic-main-m.d
fdpic-main-m.s
fdpic-main-m.sym
fdpic-main.d
fdpic-main.ld
fdpic-main.r
fdpic-main.s
fdpic-main.sym
fdpic-shared-m.d
fdpic-shared-m.s
fdpic-shared-m.sym
fdpic-shared.d
fdpic-shared.ld
fdpic-shared.r
fdpic-shared.s
fdpic-shared.sym
fix-arm1176-off.d
fix-arm1176-on.d
fix-arm1176.s
gc-hidden-1.d
gc-thumb-lib.s
gc-thumb.d
gc-thumb.s
gc-unwind.d
gc-unwind.s
gcdfn.s
group-relocs-alu-bad-2.d
group-relocs-alu-bad-2.s
group-relocs-alu-bad.d
group-relocs-alu-bad.s
group-relocs-ldc-bad-2.d
group-relocs-ldc-bad-2.s
group-relocs-ldc-bad.d
group-relocs-ldc-bad.s
group-relocs-ldr-bad-2.d
group-relocs-ldr-bad-2.s
group-relocs-ldr-bad.d
group-relocs-ldr-bad.s
group-relocs-ldrs-bad-2.d
group-relocs-ldrs-bad-2.s
group-relocs-ldrs-bad.d
group-relocs-ldrs-bad.s
group-relocs.d
group-relocs.s
hideall.ld
hidfn.s
ifunc-1.dd
ifunc-1.gd
ifunc-1.rd
ifunc-1.s
ifunc-2.dd
ifunc-2.gd
ifunc-2.rd
ifunc-2.s
ifunc-3.dd
ifunc-3.gd
ifunc-3.rd
ifunc-3.s
ifunc-4.dd
ifunc-4.gd
ifunc-4.rd
ifunc-4.s
ifunc-5.dd
ifunc-5.gd
ifunc-5.rd
ifunc-5.s
ifunc-6.dd
ifunc-6.gd
ifunc-6.rd
ifunc-6.s
ifunc-7.dd
ifunc-7.gd
ifunc-7.rd
ifunc-7.s
ifunc-8.dd
ifunc-8.gd
ifunc-8.rd
ifunc-8.s
ifunc-9.dd
ifunc-9.gd
ifunc-9.rd
ifunc-9.s
ifunc-10.dd
ifunc-10.gd
ifunc-10.rd
ifunc-10.s
ifunc-11.dd
ifunc-11.gd
ifunc-11.rd
ifunc-11.s
ifunc-12.dd
ifunc-12.gd
ifunc-12.rd
ifunc-12.s
ifunc-13.dd
ifunc-13.gd
ifunc-13.rd
ifunc-13.s
ifunc-14.dd
ifunc-14.gd
ifunc-14.rd
ifunc-14.s
ifunc-15.dd
ifunc-15.gd
ifunc-15.rd
ifunc-15.s
ifunc-16.dd
ifunc-16.gd
ifunc-16.rd
ifunc-16.s
ifunc-17.dd
ifunc-17.gd
ifunc-17.rd
ifunc-17.s
ifunc-dynamic.ld
ifunc-gdesc.r
ifunc-gdesc.s
ifunc-gdesc.ver
ifunc-static.ld
jump19.d
jump19.s
jump-reloc-veneers-cond-long-backward.d
jump-reloc-veneers-cond-long.d
jump-reloc-veneers-cond-short-backward.d
jump-reloc-veneers-cond-short.d
jump-reloc-veneers-cond.s
jump-reloc-veneers-long.d
jump-reloc-veneers-short1.d
jump-reloc-veneers-short2.d
jump-reloc-veneers.s
long-plt-format.d
long-plt-format.s
main.s
mixed-app-v5.d
mixed-app.d
mixed-app.r
mixed-app.s
mixed-app.sym
mixed-lib.d
mixed-lib.r
mixed-lib.s
mixed-lib.sym
movw-merge.d
movw-merge.s
movw-shared-1.d
movw-shared-1.s
movw-shared-2.d
movw-shared-2.s
movw-shared-3.d
movw-shared-3.s
movw-shared-4.d
movw-shared-4.s
non-contiguous-arm2.d
non-contiguous-arm2.ld
non-contiguous-arm3.d
non-contiguous-arm3.ld
non-contiguous-arm4.d
non-contiguous-arm4.ld
non-contiguous-arm5.d
non-contiguous-arm5.ld
non-contiguous-arm6.d
non-contiguous-arm6.ld
non-contiguous-arm7.d
non-contiguous-arm7.err
non-contiguous-arm7.ld
non-contiguous-arm7.s
non-contiguous-arm.d
non-contiguous-arm.ld
non-contiguous-arm.s
pcrel-shared.rd
pcrel-shared.s
pie-bind-locally-a.s
pie-bind-locally-b.s
pie-bind-locally.d
preempt-app.s
preempt-app.sym
protected-data.d
protected-data.s
rel32-reject-pie.d
rel32-reject-pie.s
rel32-reject.d
rel32-reject.s
reloc-boundaries.d
reloc-boundaries.s
rodata-merge-map1.s
rodata-merge-map2.s
rodata-merge-map3.s
rodata-merge-map.ld
rodata-merge-map.sym
script-type.ld
script-type.s
script-type.sym
stm32l4xx-cannot-fix-far-ldm.d
stm32l4xx-cannot-fix-far-ldm.s
stm32l4xx-cannot-fix-it-block.d
stm32l4xx-cannot-fix-it-block.s
stm32l4xx-fix-all.d
stm32l4xx-fix-all.s
stm32l4xx-fix-it-block.d
stm32l4xx-fix-it-block.s
stm32l4xx-fix-ldm.d
stm32l4xx-fix-ldm.s
stm32l4xx-fix-vldm-dp.d
stm32l4xx-fix-vldm-dp.s
stm32l4xx-fix-vldm.d
stm32l4xx-fix-vldm.s
thumb1-adds-armv7-m.s
thumb1-adds.d
thumb1-adds.s
thumb1-bl.d
thumb1-bl.s
thumb1-movs-armv7-m.s
thumb1-movs.d
thumb1-movs.s
thumb2-b-interwork.d
thumb2-b-interwork.s
thumb2-bl-as-thumb1-bad-noeabi.d
thumb2-bl-as-thumb1-bad.d
thumb2-bl-as-thumb1-bad.s
thumb2-bl-bad-noeabi.d
thumb2-bl-bad.d
thumb2-bl-bad.s
thumb2-bl-blx-interwork.d
thumb2-bl-blx-interwork.s
thumb2-bl-undefweak1.d
thumb2-bl-undefweak1.s
thumb2-bl-undefweak.d
thumb2-bl-undefweak.s
thumb2-bl.d
thumb2-bl.s
thumb-b-lks-sym.d
thumb-b-lks-sym.output arm: Do not insert stubs needing Arm code on Thumb-only cores. 2024-09-04 13:35:10 +00:00
thumb-b-lks-sym.s
thumb-bl-lks-sym.d
thumb-bl-lks-sym.output arm: Do not insert stubs needing Arm code on Thumb-only cores. 2024-09-04 13:35:10 +00:00
thumb-bl-lks-sym.s
thumb-entry.d
thumb-entry.s
thumb-plt-got.d
thumb-plt.d
thumb-plt.s
thumb-rel32.d
thumb-rel32.s
tls-app.d
tls-app.r
tls-app.s
tls-descrelax-be8.d
tls-descrelax-be8.s
tls-descrelax-be32.d
tls-descrelax-be32.s
tls-descrelax-v7.d
tls-descrelax-v7.s
tls-descrelax.d
tls-descrelax.s
tls-descseq.d
tls-descseq.r
tls-descseq.s
tls-gdesc-got.d
tls-gdesc-got.s
tls-gdesc-neg.d
tls-gdesc-neg.s
tls-gdesc-nlazy.g
tls-gdesc-nlazy.s
tls-gdesc.d
tls-gdesc.r
tls-gdesc.s
tls-gdierelax2.d
tls-gdierelax2.s
tls-gdierelax.d
tls-gdierelax.s
tls-gdlerelax.d
tls-gdlerelax.s
tls-lib-loc.d
tls-lib-loc.r
tls-lib-loc.s
tls-lib.d
tls-lib.r
tls-lib.s
tls-local-static.d
tls-local-static.s
tls-longplt-lib.d
tls-longplt-lib.s
tls-longplt.d
tls-longplt.s
tls-mixed.r
tls-mixed.s
tls-thumb1.d
tls-thumb1.s
unresolved-1-dyn.d
unresolved-1.d
unresolved-1.s
unresolved-2.d
unresolved-2.s
unwind-1.d
unwind-1.s
unwind-2.d
unwind-2.s
unwind-3.d
unwind-3.s
unwind-4.d
unwind-4.s
unwind-5.d
unwind-5.s
unwind-mix1.s
unwind-mix2.s
unwind-mix.d
unwind-rel1.s
unwind-rel2.s
unwind-rel3.s
unwind-rel.d
use-thumb-lib.s
use-thumb-lib.sym
vfp11-fix-none.d
vfp11-fix-none.s
vfp11-fix-scalar.d
vfp11-fix-scalar.s
vfp11-fix-vector.d
vfp11-fix-vector.s
vxworks1-lib.dd
vxworks1-lib.nd
vxworks1-lib.rd
vxworks1-lib.s
vxworks1-lib.td
vxworks1-static.d
vxworks1.dd
vxworks1.ld
vxworks1.rd
vxworks1.s
vxworks2-static.sd
vxworks2.s
vxworks2.sd