Include archive member section with ld script (+ somewhat RFC)
Vincent Rubiolo
vincent.rubiolo@st.com
Wed Jun 11 15:56:00 GMT 2003
Hi,
Could sb give a clear explanation on how to include a given section of an archive member in an ld
script (if there is such a possibility). Is it me or is the documentation more than obscure on that
point?
Follows what I understood from ld manual:
********************************************************************************
Include .text section of foo.o file (must be passed as foo.o on the command line)
foo.o (.text)
Include archive member foo.o of archive archfoo.a (all sections of the file foo.o, must be archfoo.a
as argument)
archfoo.a (foo.o)
********************************************************************************
My question is:
---------------
How to include a specific section of an archive member in my ld script?
I would like to do :
archfoo.a(foo.o) (.text) but such a syntax is not accepted by ld
Somewhat RFC:
-------------
Since ld only looks for files that are passed as arguments, wouldn't it be easier to put
foo.o (.text)
instead of
complete_path_of_foo/foo.o (.text)
in our script?
The problem would only arise if two files with the same name but with different paths have to be
included but this is a strange way of doing things, IMO.
Thanks for your answer,
Vincent
More information about the Binutils
mailing list