[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help on build failure of patchelf on mips variants



On Tue, 2016-04-05 at 23:33 +0100, James Cowgill wrote:
> On Tue, 2016-04-05 at 16:13 -0300, Felipe Sateler wrote:
> > 
> > I'm currently at a loss on why does patchelf fail to build (or rather,
> > it fails its testsuite) on all mips variants[1].
> > 
> > Patchelf modifies ELF binaries, to add/remove RPATH and other
> > sections. On all mips variants, some tests fail. From what I can tell,
> > the loader complains that the new (altered) file has an invalid
> > MIPS.abiflags section, and yet from what I can tell both the original
> > and altered binaries have the same (as reported by readelf).
> > 
> > I have printed some more logs at the upstream issue tracker:
> > https://github.com/NixOS/patchelf/issues/82
> > 
> > Any help would be appreciated. I'd rather not remove patchelf from mips.
> I had a go at using patchelf on a hello world executable and the
> executable immediately segfaulted. From 'readelf -e':
> 
> Before:
>   [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
>   [ 3] .MIPS.abiflags    MIPS_ABIFLAGS   00400188 000188 000018 18   A  0   0  8
> 
>   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
>   ABIFLAGS       0x000188 0x00400188 0x00400188 0x00018 0x00018 R   0x8
> 
> After:
>   [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
>   [ 1] .MIPS.abiflags    MIPS_ABIFLAGS   003fc174 000174 000018 18   A  0   0  4
> 
>   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
>   ABIFLAGS       0x004188 0x00400188 0x00400188 0x00018 0x00018 R   0x8
> 
> Here the ABIFLAGS segment (this is a special MIPS specific segment
> type) is wrong after running patchelf.

Also this page will be useful for anyone trying to fix this bug. It
contains the "spec" for the abiflags section:

https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking

James

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: