This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Include archive member section with ld script (+ somewhat RFC)
- From: Vincent Rubiolo <vincent dot rubiolo at st dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 11 Jun 2003 17:59:10 +0200
- Subject: Include archive member section with ld script (+ somewhat RFC)
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