bfd: Discard symbol regardless of warning flag
commit106791196f98a0f21babf4dd46a731b5d1747d3b
authorTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Sat, 17 Dec 2022 10:16:19 +0000 (17 11:16 +0100)
committerTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Tue, 20 Dec 2022 10:37:22 +0000 (20 11:37 +0100)
treeddea0ae2f01acd04488d88001e584ba4186dfb80
parent9d0991449285833b9a77cc02850a1e113e460362
bfd: Discard symbol regardless of warning flag

The discard of symbols should be performed whether the warning for
the discard is enabled or not.
Without this patch, ld would segfault in bfd_section_removed_from_list,
called in the if-statement right after this block, as the argument
isec->output_section can be NULL.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Co-Authored-By: Yvan ROUX <yvan.roux@foss.st.com>
bfd/elflink.c
ld/testsuite/ld-arm/arm-elf.exp
ld/testsuite/ld-arm/non-contiguous-arm7.d [new file with mode: 0644]
ld/testsuite/ld-arm/non-contiguous-arm7.ld [new file with mode: 0644]
ld/testsuite/ld-arm/non-contiguous-arm7.s [new file with mode: 0644]