[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Selective linking using ld
From: |
tbr |
Subject: |
Selective linking using ld |
Date: |
Mon, 22 Apr 2002 23:24:37 +0200 |
I hope someone can help me with some answers regarding the use of option
--gc-sections in ld.
Since I am experiencing troubles with the --gc-sections option in our PowerPC
target environment with 'binutils-2.11.2', I went on the net, and found an
"update for new snapshot" dated April 6, 2001 and which directly described my
problem.
The problem I have is that .init section contributions are removed, if there is
no public symbol in the contribution and - if there is - that this public symbol
is not referenced from some other included section. I have a 'first' and 'last'
set of object files that surrounds the linked-in files as a parenthesis, where
you enter into the 'first' object file's .init (and .fini for that matter)
section, run through contributions from the object files and libraries
mentioned, and end in the 'last' object file's .init (and .fini) section, from
which a controlled return is performed.
Only, the contribution from 'last' module is considered not used, removed, and
no return is performed.
So to my questions:
Question #1:
Since a year has passed now, I would like to know, if this problem has found
a solution yet ?
Question #2:
The object modules that our target system produces use DWARF format, where
all the code in a single object module is described. If say one object module
defines 5 functions, where of #2 and #5 are actually used, will the-
-gc-sections option include #1, #3 and #4 as well, just because they are
referenced from the DWARF sections?
Not compiling with DWARF generation is not an option, I should add.
Question #3:
If the DWARF references do not trigger the inclusion what will be the value
of the references that end up pointing to not loaded functions?
Question #4:
Is the principle that everything transitively referenced from the application
entry point is included?
I sincerely hope someone can help me with answers to these four questions, as I
otherwise have to figure out another strategy, if I wish to provide a selective
linking capability in our product.
Regards
Thorkil B. Rasmussen
DDC International A/S (DDC-I, Inc)
Copenhagen, Denmark
Email: address@hidden
- Selective linking using ld,
tbr <=