From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uros Prestor To: binutils@sources.redhat.com Cc: uros.prestor@nexsi.com Subject: Relocatable executables Date: Wed, 22 Aug 2001 13:14:00 -0000 Message-id: <3B8412F6.FC10F886@nexsi.com> X-SW-Source: 2001-08/msg00520.html Hello, I am using gcc/binutils to develop software for an embedded system (MIPS ELF). The executable is statically linked at a fixed text address, no PIC. At load time I need to relocate the executable at a different address. Is there a way to have ld include relocation info in the executable? The naive approach of adding the following two lines in the linker script does not seem to work: .rel.text : { *(.rel.text) } .rel.data : { *(.rel.rodata) *(.rel.data) } On the other hand, compiling with PIC and creating a shared library is too heavy handed. Is there an easier way to have ld emit enough info in the ELF file to allow for a load-time relocation? Thanks in advance, Uros P.S. Please keep me on the cc: list as I am not subscribed to binutils. -- Uros Prestor uros.prestor@nexsi.com