How to get the default linker script used by gcc?
Ian Lance Taylor
iant@google.com
Mon May 11 20:00:00 GMT 2009
Pan ruochen <panruochen@gmail.com> writes:
> In fact, I want to append the following scripts
>
> SECTIONS {
> .array : {
> array = ABSOLUTE(.);
> res.o (.data)
> array_size = ABSOLUTE(.) - array;
> }
> }
> to the default linker script used by ld.
> Is there any simple way to do this, except copying and modifying the
> default linker script?
It looks like all you want is a way to get the address and size of the
.array section. If you give the section a name which can be used as a
variable name in C (i.e., no '.' character) then the linker will
automatically define __start_SECNAME and __stop_SECNAME symbols which
you can use.
http://www.airs.com/blog/archives/56
Ian
More information about the Binutils
mailing list