Is the GOT not sufficient to do this though ? I can’t see why it is necessary to define two new sections ? What goes into those sections ?
The GOT is sufficient if you have a shared library loader that knows how to read ELF files and apply the relocations embedded within.
The -mrelocatable option tries to make this easier for embedded targets by emitting code that does the relocations for you, and storing the relocation info in regular object file data sections. See the gcc/config/rs6000/eabi.asm file, in particular the __eabi_convert function and its callers, which uses the got2 and fixup sections to perform relocations when a program is loaded at a different address than it was linked for.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com