https://sourceware.org/bugzilla/show_bug.cgi?id=25665
--- Comment #12 from Tamar Christina <tnfchris at sourceware dot org> --- Hi rrorden, While looking through the source code I noticed that AArch64 already has flag to control how and where stub sections get placed. If you look at the documentation https://sourceware.org/binutils/docs/ld/ARM.html#ARM there's a flag called --stub-group-size=N which actually not only controls group sizes but also placements. There are two special values here: +1: The default which tells the linker to try to use heuristics to place the stubs. These heuristics will favor code-size hence the error you're seeing. The heuristic here is telling it to put all stubs together after all sections to minimize code-size impact. -1: This flips this heuristics to favor distance over size. What this will do is if possible keep all stubs together, but if not it will place them directly after the section which has the function that needs them. The downside here is that it may have to duplicate veneers, which is not unreasonable since the other one is out of range. It won't do the duplication if another usable veneer is in range. Now any other value for N will tell the linker that the veneers can service at most N bytes away from the input section with the + or - giving you the direction. So in our case, you just need to use the --stub-group-size=-1 heuristics and this will fix your case. Can you confirm and let me know? -- You are receiving this mail because: You are on the CC list for the bug.