bfd: ensure that symbols targeted by DWARF relocations are kept in XCOFF
authorClément Chigot <clement.chigot@atos.net>
Thu, 29 Jul 2021 07:50:37 +0000 (09:50 +0200)
committerClément Chigot <clement.chigot@atos.net>
Fri, 30 Jul 2021 06:38:14 +0000 (08:38 +0200)
commit8ba4f8f6c2586f873422ffcf002bbb5d78c4e0b6
treede6a5a597f03a04a65cc82bb13b3e1ab78cf5c75
parent1417c848426871e767342ffbc673198145f4cec7
bfd: ensure that symbols targeted by DWARF relocations are kept in XCOFF

This patch improves XCOFF garbage collector pass, in order to keep
symbols being referenced only by special sections like DWARF sections.

bfd/
* xcofflink.c (xcoff_mark): Replace SEC_MARK by gc_mark.
Look through relocations even if xcoff_section_data is NULL.
(xcoff_sweep): Check if any sections of a file is kept before
adding its special sections.
Call xcoff_mark for special sessions being kept instead of just
marking them.
(SEC_MARK): Remove
(xcoff_mark_symbol): Replace SEC_MARK by gc_mark.
(xcoff_keep_symbol_p): Likewise.
(bfd_xcoff_size_dynamic_sections): Likewise.
(xcoff_find_tc0): Likewise.
bfd/xcofflink.c