This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Linkage order
- From: Florian Weimer <fweimer at redhat dot com>
- To: "Hauke Krüger(IND)" <krueger at ind dot rwth-aachen dot de>, gcc-help at gcc dot gnu dot org
- Date: Tue, 19 Aug 2014 11:21:31 +0200
- Subject: Re: Linkage order
- Authentication-results: sourceware.org; auth=none
- References: <53F2F748 dot 1010106 at ind dot rwth-aachen dot de> <53F314C9 dot 7040807 at redhat dot com> <53F31669 dot 1010306 at ind dot rwth-aachen dot de>
On 08/19/2014 11:18 AM, "Hauke Krüger(IND)" wrote:
Hi,
thank you for your answer.
On 08/19/2014 09:05 AM, "Hauke Krüger(IND)" wrote:
Question: Can I somehow tell the linker to prefer "local" function calls
such that this problem is solved?
This is more of a binutils question. One way to do this reliability
with static linking is to use "ld -r --retain-symbols-file".
I can see with nm that the "--retain-symbols-file" option leads to a
library file that only exposes those symbols specified in the file
given as argument. Is that the list of symbols which also the ld tool
really sees?
Yes, if you look at "nm -D" output (or "readelf -W -s").
Why the option -r?
To produce an object which can be linked again (statically or even
dynamically, if the code is position-independent).
--
Florian Weimer / Red Hat Product Security