[PATCH] x86-64: Resolve R_X86_64_PLT32 referencing a local symbol even if defined in another section

H.J. Lu hjl.tools@gmail.com
Thu Feb 13 17:43:00 GMT 2020


On Thu, Feb 13, 2020 at 9:29 AM Fangrui Song <maskray@google.com> wrote:
>
> On 2020-02-13, H.J. Lu wrote:
> >On Wed, Feb 12, 2020 at 11:25 PM Fangrui Song <maskray@google.com> wrote:
> >>
> >> See gas/testsuite/gas/i386/relax-5.s
> >> Currently gas incorrectly emits a .L symbol.
> >> Context: https://github.com/ClangBuiltLinux/linux/issues/811
> >>
> >> (begin story
> >>
> >> I taught clang to emit a call insn referencing a local symbol if the
> >> symbol is defined in the same translation unit. This can avoid unneeded
> >> PLT if the object file is linked with -shared.
> >
> >Why does a linker generate a PLT entry for PLT32 relocation against a local
> >symbol?  Does BFD linker have the same issue?
>
> The problem is not a linker, but objtool (used by the Linux kernel)'s
> unneeded constraint on st_type.
>

I don't have any problem with PLT32 and objtool in the current Linux kernel.
Are you using very old Linux kernel?

-- 
H.J.



More information about the Binutils mailing list