https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106671
--- Comment #5 from Richard Earnshaw <rearnsha at gcc dot gnu.org> --- (In reply to D Scott Phillips from comment #2) > th(In reply to Andrew Pinski from comment #1) > > Shouldn't the linker add the BTI inside the ___veneer instead? > > The bti instruction has to be placed at the target of the indirect branch > (at the top of `func` in this case) so I don't think it would be possible to > work around this just within the veneer. The veneer has to be placed 'near' the target and then end with a direct branch instruction. The linker should be able to work this out.