tag 794488 = patch thanks Kurt Roeckx wrote on 08.08.2015 12:06: > On Sat, Aug 08, 2015 at 11:47:04AM +0200, Mark Wielaard wrote: >> On Sat, Aug 08, 2015 at 10:58:15AM +0200, Kai Wasserbäch wrote: >>> And there *IS* a difference vs. your output: for you the relocations in >>> 794488_elfs/libelf1/dump.elf.J4EnbO look fine, for me the second relocation >>> is >>> botched with libelf1 while it works with libelfg0. >>> >>> libelf1: >>> relocations: 2 >>> 0: 10, SCRATCH_RSRC_DWORD1 >>> 1: 200000081, >>> >>> libelfg0: >>> relocations: 2 >>> 0: 10, SCRATCH_RSRC_DWORD1 >>> 1: 2c, SCRATCH_RSRC_DWORD0 >> >> Awesome. That should explain why the application of that relocation >> crashes and burns. Odd I couldn't replicate locally against elfutils >> libelf 0.163. It might be some subtle compiler code generation issue. >> Or maybe debian applies a patch that isn't upstream? >> Yep! >> https://sources.debian.net/src/elfutils/0.163-4/debian/patches/0003-Add-mips-n64-relocation-format-hack.patch/?hl=34#L34 >> >> Note how that replaces the cast and sizeof Elf64_Rel with Elf64_Rela >> in the memcpy. Those are not the same size! >> >> Could someone rebuild the debian package without that patch applied >> (or correctly replace the wrong Elf64_Rela with Elf64_rel) and see if >> that helps? > > I'm guessing that's only for the gelf_getrel.c file and that the change > in gelf_getrela.c is correct?
That seems to be correct. I've rebuilt elfutils with a fixed 0003-Add-mips-n64-relocation-format-hack.patch and it works for me: $ for i in 794488_elfs/libelf*/dump.elf.*; do ./elfrel_elf1-fixed $i; done file: 794488_elfs/libelf1/dump.elf.EL5kJT .text code size: 24 Nothing found file: 794488_elfs/libelf1/dump.elf.J4EnbO .text code size: 11c symbols: 5 1: not global or undefined 2: not global or undefined 3: not global or undefined 4: not global or undefined 5: 0 relocations: 2 0: 10, SCRATCH_RSRC_DWORD1 1: 2c, SCRATCH_RSRC_DWORD0 file: 794488_elfs/libelfg0/dump.elf.7NnBvc .text code size: 24 Nothing found file: 794488_elfs/libelfg0/dump.elf.ahPsJJ .text code size: 11c symbols: 5 1: not global or undefined 2: not global or undefined 3: not global or undefined 4: not global or undefined 5: 0 relocations: 2 0: 10, SCRATCH_RSRC_DWORD1 1: 2c, SCRATCH_RSRC_DWORD0 file: 794488_elfs/libelfg0/dump.elf.DYTjdO .text code size: 28 Nothing found file: 794488_elfs/libelfg0/dump.elf.Lke6Xg .text code size: 38 Nothing found Also, the Piglit test passes again, and doesn't segfault any longer. Attached you can find the debdiff between the current package and a fixed package (sorry, that the diff is a bit larger, but I had to refresh some patches, otherwise dpkg-buildpackage complained). Cheers, Kai
elfutils_794488.debdiff.xz
Description: application/xz
signature.asc
Description: OpenPGP digital signature