1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-11 13:06:59 +03:00

[PPC32] Do not discard .got2 even if --gc-sections is given

Even though .got2 may not be referenced directly, we use that section
when processing relocations.
This commit is contained in:
Rui Ueyama 2024-03-10 18:14:11 +09:00
parent 6356fa09e9
commit 8eae0a33b3

View File

@ -15,6 +15,10 @@ static bool should_keep(const InputSection<E> &isec) {
u32 flags = isec.shdr().sh_flags;
std::string_view name = isec.name();
if constexpr (is_ppc32<E>)
if (name == ".got2")
return true;
return (flags & SHF_GNU_RETAIN) ||
type == SHT_NOTE ||
type == SHT_INIT_ARRAY ||