
What is the fixup section used for ?
of the 274 cards that build on my MAKEALL not one has any entries into this section.

On Wed, 2008-04-09 at 11:32 +0200, Kenneth Johansson wrote:
What is the fixup section used for ?
of the 274 cards that build on my MAKEALL not one has any entries into this section.
These are needed for relocation of function pointers(and possible some think more). There was an attempt by Grant Likely to enable this functionalty, but some toolchains had problems with so the function was disabled. If you undo commit 1c3dd43338a077165e7e0309cb3994e65d2bdbf8 you will enable it again for powerpc.
Jocke

On Wed, 2008-04-09 at 13:23 +0200, Joakim Tjernlund wrote:
On Wed, 2008-04-09 at 11:32 +0200, Kenneth Johansson wrote:
What is the fixup section used for ?
of the 274 cards that build on my MAKEALL not one has any entries into this section.
These are needed for relocation of function pointers(and possible some think more). There was an attempt by Grant Likely to enable this functionalty, but some toolchains had problems with so the function was disabled. If you undo commit 1c3dd43338a077165e7e0309cb3994e65d2bdbf8 you will enable it again for powerpc.
Jocke
aaahhaa so that is how it's working.
I remember having problem understanding this when I did the command section and ended up doing a manual relocation of the command table. But compiling with -mrelocatable and going over the .fixup section instead I can now remove that extra code and it works fine.
It's not easy to understand the ABI.
I removed the -fPIC and only used -mrelocatable and that works too.
Wonder if there is something else in u-boot that use function pointers and work by accident due to the fact that the old address in flash is still valid.
--- `-mrelocatable' `-mno-relocatable' On embedded PowerPC systems generate code that allows (does not allow) the program to be relocated to a different address at runtime. If you use `-mrelocatable' on any module, all objects linked together must be compiled with `-mrelocatable' or `-mrelocatable-lib'.

-----Original Message----- From: Kenneth Johansson [mailto:kenneth@southpole.se] Sent: den 9 april 2008 16:47 To: joakim.tjernlund@transmode.se Cc: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] Fixup entries
On Wed, 2008-04-09 at 13:23 +0200, Joakim Tjernlund wrote:
On Wed, 2008-04-09 at 11:32 +0200, Kenneth Johansson wrote:
What is the fixup section used for ?
of the 274 cards that build on my MAKEALL not one has any entries into this section.
These are needed for relocation of function pointers(and possible some think more). There was an attempt by Grant Likely to enable this functionalty, but some toolchains had problems with so the function was disabled. If you undo commit 1c3dd43338a077165e7e0309cb3994e65d2bdbf8 you will enable it again for powerpc.
Jocke
aaahhaa so that is how it's working.
I remember having problem understanding this when I did the command section and ended up doing a manual relocation of the command table. But compiling with -mrelocatable and going over the .fixup section instead I can now remove that extra code and it works fine.
It's not easy to understand the ABI.
I removed the -fPIC and only used -mrelocatable and that works too.
Wonder if there is something else in u-boot that use function pointers and work by accident due to the fact that the old address in flash is still valid.
Oh yes, there are a few such pointers. And the conversion to using fixups instead is a bit lazy. Several manual relocations has only been nullified by setting gd->reloc_off=0 instead of #ifdef:ing out the relevant code. Feel free to send patches :)
Jocke
participants (3)
-
Joakim Tjernlund
-
Joakim Tjernlund
-
Kenneth Johansson