This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: About ld scirpts and genscripts.sh


Paul Chavent <paul.chavent@fnac.net> writes:

> I would like to build a cross development toolchain. I have an
> 'emulparams', an 'emultempl' and a  'scripttempl' file.
> I would like to know the diference between :
> - Insert them in the source tree of ld before compiling binutils (so
> it compile ld with the .c generated file).
> - Simply use my ld script with the option -T of ld.
> 
> Or in other words, what does the *.c generated file do ?

There is no difference.  At least, there is no difference other than
the fact that when the linker uses a builtin script it will work as a
standalone binary--it will not have to locate the script in the
filesystem somewhere.

I should also mention what you probably already know, that a
scripttempl file normally generates a set of different linker scripts
which are used in different scenarios.

> A last question :
> If i specify a emulation with no 'emultempl' script, is there any
> sense ? Do i need to modify the source tree of ld or can i simply use
> my ld script with the option -T of ld ?

The -T option selects a linker script, and more or less corresponds to
a scripttempl file.  The -m option selects an emulation, which fairly
directly corresponds to an emulparams file.  The emulparams file
selects an emultempl file via the TEMPLATE_NAME variable; if
TEMPLATE_NAME is not specific, "generic" is used.

So, specifying an emulation always implies an emultempl file, via the
emulparams file.  Note that the emulation is more than just the linker
script.  For example, the linker will not do correct ELF linking if
you do not use the elf32.em emultempl file (or something with
equivalent functionality) no matter what linker script you use.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]