how to keep some basic relocation information in executable binary

Peiyu Li Peiyu.Li at csr.com
Thu Oct 1 21:27:56 EDT 2009


Hi, 

I am trying to find a way to build out one ARM-instruction binary that
can run at any address in the bare metal environment. The GOT can
relocate most of the symbols. But for those pointers which have been
static initialized in struct, I have not found a good way to fix them at
run-time. As you know, there may be pointers or non-pointers data in the
struct. To only fix the pointer data, I must know the detail relocation
information at run-time. 
It seems that -emit-relocs option is designed for runtime relocation,
and it can keep the relocation information in the final elf format
executable file. After convert this elf format to the binary format by
using "objcopy" tool, the relocation information is lost. I still can
not know which data need to be relocated in the static initialized
struct.

How can I know the relocation information for these static initialized
struct? Besides that pointers in GOT and the static initialized struct ,
is there any other data should be run-time relocated in the binary
executable file?
Any help would be greatly appreciated.
Thanks in advance.
Peiyu 1



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



More information about the linux-arm-kernel mailing list