Comment 3 for bug 1833237

Revision history for this message
In , Alan Modra (amodra-gmail) wrote :

This is due to a horrible linker script breaking a new GOT indirect to GOT relative optimisation (git commit 066f4018ae78).

ld does a preliminary layout to see whether various optimisations can be done. In this case the preliminary layout indicates that code using a GOT indirect address can be replaced with code calculating a GOT relative address (saving a GOT entry and load from memory). The trouble is that skiboot.lds puts a bunch of dynamic sections between .got and the address in question. Those dynamic sections are not filled out for the preliminary layout, nor can they be since one of the aims of the ppc64 linker optimisation is to reduce dynamic relocations. With the dynamic sections adding over 150kb, the optimisation is no longer valid but ld has already removed the GOT entry.