Re: Help on build failure of patchelf on mips variants

James Cowgill <[email protected]>
Newsgroups gmane.linux.debian.ports.mips
Message-ID <[email protected]>
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
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAABCgAGBQJXBD6iAAoJEMfxZ23qLQHv8FEP/0kA/Fewbr9cfL8B1SjVGP3a
DnI9DEkeHivTkgbpKipoxSo2uw/p3bQRmlhNqpWeg7WJ10yL5/+nm+ROUtcofjEr
ha7erx1OXPy37NKlVnoXwnXUuMu9N4pVObuK8EHUnUUen2DevsKh1UMujg3XAmo4
zMIdFztecqCXLgnp7R0iSp20JC6KLsl0cSTqiohgYpHaVvIA8tli/qqCgCEu81Ua
FLEQI3/IOwpI+k8uhtbdCbbvvMcyuEW07OtRjhHQe4yhNGDQoK5yHjvXmJIeBKpF
7Ziu3y53chrbDfhkOabP24e/M4F5EjL8jipIEpIQU/2/mxRYm85n5MQIBih/5j1o
1ZgfyaR9cISykv+6ZccZrtHVgpT6g0ZfrNN8WUj0NWpzw0HKP1CepIEuV8cHFpts
49fkNhq6J36tF6dXrTK3BZFd9oDsbC2GfI/yUydQ16zj06Q7EMvGb+FiFGj9dUwW
ltr0XXgl6PSQrQzzDrWgwHz43Oxdw4/YE/UMxf3oPHcemUxpp/VdtCNGv1nQQ1C0
FhvbnwfuzrWJ7+zsvmAAQj4BEAWxWGkKBKKLDESGnsAQ0w9s8nkTh+UKL+QaeMlZ
o+DOx/CWsVCmr3Wf8CTL4JYNjshfmeHQN3KR/eEYkUmxDw6nKcshzh3F6dCl0v80
WwHDD3xESrZjv5om19lN
=qibw
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.