Michel Dänzer wrote on 05.08.2015 12:08: > On 05.08.2015 18:55, Mark Wielaard wrote: >> On Wed, 2015-08-05 at 11:13 +0900, Michel Dänzer wrote: >>> Note that the ELF object is actually created in LLVM. >> >> Do you happen to know whether that also uses libelf to generate the >> file? > > AFAICT LLVM doesn't use libelf, presumably it has its own ELF code.
That's correct. LLVM has it's own ELF code and isn't linked against any libelf{1,g0}. You can find that code in the lib/MC directory of LLVM (online browsable version: <https://github.com/llvm-mirror/llvm/tree/master/lib/MC>). There are several ELF writing related files in there, like ELFObjectWriter.cpp (<https://github.com/llvm-mirror/llvm/blob/master/lib/MC/ELFObjectWriter.cpp>). The AMDGPU backend instances this in <https://github.com/llvm-mirror/llvm/blob/master/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp> >> I am assuming there is some bug in the relocation section parsing >> and that the generated ELF images are identical in the old/new >> situation. But maybe the ELF images generated are actually different? >> Kai, would it be possible to run the tweaked code to dump the ELF images >> to disk against both the old/new libelf and see if they differ? > > I can't speak for Kai, but I didn't change anything about LLVM between > the failing and working case, so the generated ELF objects should be > identical in both cases. That's the same for me: I can take any Mesa build I've done and link it against libelf1 (0.163) and it fails or link it against libelfg0 and it works. The code responsible for writing is unchanged between these too (ie. they are linked against the same libLLVM-3.8). The radeonsi driver in Mesa only reads the generated ELF and passes it on to the kernel/GPU (AFAIK). So, if I've understood you correctly, you want an ELF dump of a Mesa build linked against libelfg0 and one linked against libelf1. You can find the generated files in the attached Tar archive. Please note, that the run with libelf1 only produced two dumps before segfaulting. Cheers, Kai
794488_elfs.tar.xz
Description: application/xz
signature.asc
Description: OpenPGP digital signature