[PATCH] D80390: [WIP][mips] Support 64-bit relative relocations

Joe Holden via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 30 10:35:23 PDT 2020


joewholden added a comment.

In D80390#2064941 <https://reviews.llvm.org/D80390#2064941>, @MaskRay wrote:

> In D80390#2064929 <https://reviews.llvm.org/D80390#2064929>, @joewholden wrote:
>
> > In D80390#2064903 <https://reviews.llvm.org/D80390#2064903>, @MaskRay wrote:
> >
> > > In D80390#2064895 <https://reviews.llvm.org/D80390#2064895>, @joewholden wrote:
> > >
> > > > Ok so, just stumbled upon one issue but I'm not yet sure where the problem lies given how bad mips support is in Go:
> > > >
> > > > ld: error: section type mismatch for .debug_line
> > > >
> > > > >>> /tmp/go-link-985122218/000010.o:(.debug_line): SHT_MIPS_DWARF
> > > > >>>  output section .debug_line: SHT_PROGBITS
> > > >
> > > > I'm still testing though, so I'll see what I uncover...
> > >
> > >
> > > According to https://github.com/llvm/llvm-project/blob/master/llvm/lib/MC/MCObjectFileInfo.cpp#L404 , .debug_line on MIPS should use `SHT_MIPS_DWARF` (different from all other targets). Go produced assembly should do the same. LLD has such a rigorous check for section type compatibility.
> >
> >
> > Go actually produces binaries that trip LLVM up quite often - another example is llvm-strip, I should probably file another bug for that though
> >
> > GNU binutils are much more relaxed when it comes to these checks, so I expect Go elf tools don't get properly tested
>
>
> I'd prefer we don't touch the section compatibility code in LLD. This should be easily fixable in Go assembly emitter.
>
> FWIW GNU as 2.35 made things more rigorous as well https://sourceware.org/pipermail/binutils/2020-February/109945.html. GNU ld is still loose (even mixing SHT_REL and SHT_RELA is ok). They might keep that behavior for compatibility reasons. In LLD, these things don't work currently and there is no need to appease old versions of them.


Yeah I'm totally in agreement, I 100% blame Go for this - maybe they will pay attention if gnu starts breaking things


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80390/new/

https://reviews.llvm.org/D80390





More information about the llvm-commits mailing list