https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67215

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to H.J. Lu from comment #5)
> Created attachment 36190 [details]
> A patch
> 
> For x86, -fno-plt should be handled by ix86_expand_call to
> generate indirect call via GOT, not by forcing the function
> address into a register in prepare_call_address.

We can avoid adding targetm.calls.call_via_reg_without_plt by
hijacking flag_plt:

if (!flag_plt)
{
  flag_x86_plt = 1;
  flag_plt = 0;
}

Reply via email to