binutils Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
binutils/ld

hppa64: Disable -gc-section support on hppa*64*-*-hpux*

Disables `-gc-section` support for HP-UX on hppa64 due to dynamic linker issues with R_PARISC_NONE relocations.

The HP-UX dynamic linker on hppa64 platforms generates an error when encountering dynamic relocations with the type R_PARISC_NONE. This commit disables -gc-section support on hppa*64*-*-hpux* to avoid these errors, as there is no reliable way to handle relocations in garbage-collected sections. Testsuite entries are also updated to reflect this change.

In Details

The HP-UX dynamic linker's inability to handle R_PARISC_NONE relocations in garbage-collected sections necessitates disabling -gc-section. The patch modifies elf64-hppa.c to disable garbage collection and updates the linker testsuite to xfail affected tests. This issue is specific to HP-UX on hppa64.

For Context

Linker garbage collection (-gc-sections) removes unused sections from the final executable, reducing its size. Relocations are adjustments the linker makes to code and data addresses when combining object files. This commit disables linker garbage collection for HP-UX on hppa64 because the HP-UX dynamic linker has issues processing a specific type of relocation (R_PARISC_NONE) in sections that have been garbage collected. This prevents errors during program execution.

Filed Under: ldhppa64hp-uxgc-sections