This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/70146] missed-optimization: i386 hidden references should use PC32 relocations instead of GOTOFF
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 11 Mar 2016 03:43:38 +0000
- Subject: [Bug target/70146] missed-optimization: i386 hidden references should use PC32 relocations instead of GOTOFF
- Auto-submitted: auto-generated
- References: <bug-70146-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70146
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Andy Lutomirski from comment #3)
> I think a similar optimization could be applied to default-visibility
> references as well. For example, gcc can generate things like this:
>
> call __x86.get_pc_thunk.ax
> addl $_GLOBAL_OFFSET_TABLE_, %eax
> movl foo@GOT(%eax), %eax
>
> The addl is unnecessary.
Yes, GCC does it for MacOS.