https://sourceware.org/bugzilla/show_bug.cgi?id=32478
Bug ID: 32478 Summary: AArch64: Excessive Size of Linked Output When Using BFD or Gold Linker Product: binutils Version: 2.43 Status: UNCONFIRMED Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: jonathan.gruber.jg at gmail dot com Target Milestone: --- Overview: Programs and shared libraries built via the bfd or gold linker for the target platform aarch64-linux-gnu are quite large, even when stripped. I have observed this behavior regardless of whether the linked object files have been compiled with gcc or clang (indicating that it is a linker-specific issue rather than a compiler-specific issue) and regardless of the optimization level with which the object files were compiled. When using a different linker such as lld or mold, the size of the programs and shared libraries is much more reasonable. Steps to Reproduce / Minimal Test-Case: 1) Create a dummy C source file with just an empty main function (if building an executable) (i.e. "int main(void) {}") or any other empty function (if building a shared library) (e.g. "void dummy(void) {}"). 2) Build an executable or shared library from the dummy C source file for the target platform aarch64-linux-gnu, using either the aarch64-linux-gnu bfd or gold linker. (Whichever compiler and optimization level you use does not seem to matter.) Do not pass any additional options to the linker via compiler flags such as "-Wl". Observe that, even if you strip the program or library, the size is ~70k bytes. 3) Repeat step 2 but link using another linker such as lld or mold. Observe that the size of the program or library, even unstripped, is on the order of 10k bytes, which is a much more reasonable size. Host platform: Arch Linux, x86_64. Binutils version: official Arch Linux package aarch64-linux-gnu-binutils, version 2.43-1. -- You are receiving this mail because: You are on the CC list for the bug.