Hi Alexander, On Wed, 08 Dec 2021 18:42:05 +0100 Alexander Egorenkov <egorenar@xxxxxxxxxxxxx> wrote: > Hi Philipp, > > Philipp Rudo <prudo@xxxxxxxxxx> writes: > > > Hi Alexander, > > > > thanks for taking care of this so fast! > > > > My personal approach was slightly different (see below). The idea > > behind this was that arch_kexec_do_relocs is also used by others which > > might have a PLT. For them your approach would mean an ABI breakage. On > > the other hand in case the other users have the same problem they would > > need to handle it for themselves. Not sure what's the better approach. > > > > I'm also fine with your proposal for the fix. > > If i'm not mistaken, arch_kexec_do_relocs() is used in decompressor and > for purgatory at the moment, and both should have all relocs resolved. > Do we have more users of arch_kexec_do_relocs() ? That was the reason i > added the fix to arch_kexec_do_relocs(). no, there are no other users of arch_kexec_do_relocs other than kexec_file and kaslr at the moment. >From a technical perspective your patch was totally fine for todays use cases. My concern was more for a potential future user. But maybe I was a little bit overcautious... > Now i'm actually wondering why we don't have any issues with > decompressor, probably because we do the final link where all > PLT-relative addresses are fixed. Because i see plenty of R_390_PLT32DBL > in startup.o e.g. IIUC, the culprit is the '-r' option in the LDFLAGS. With this option the output can be used again as input _for ld_. The way I interpret this is that ld can (and apparently does) use any internal convention without complying with the ABI when this option is given. kaslr doesn't use '-r' but a combination of -fPIE (CFLAGS) and -pie (LDFLAGS) so they are not affected by ld's internal behavior. Maybe it's worth investigating in the long run if the purgatory could be build with -fPIE/-pie as well. Thanks Philipp