Linking images at one address, but loading them at another.
Richard Earnshaw
rearnsha@arm.com
Fri Oct 26 02:10:00 GMT 2001
> Hi Richard,
>
> > However, this image contains symbols, if I try to strip the image
> > (eg to remove debug data):
> >
> > arm-elf-strip -g -o os os.gdb
> > BFD: netbsd: warning: allocated section `.text' not in segment
>
> Not sure about this one. It sounds like a bug in strip. Can you
> create a small example for us to test ?
Attached below. Should work with pretty much any ELF toolchain. Note,
however, that the example is not executable.
Compile with
gcc -g t.c
link with
ld -T ldscript.sample -o t.gdb t.o
strip with
strip -g -o t t.gdb
>
> > Is there some other way of setting the load address of a segment
> > symbolically?
>
> This sounds like a job for memory regions. For example this script:
OK, I'll give this a go. Thanks for the tip.
Richard
More information about the Binutils
mailing list