This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
gold linker: rejected multiple definitions with the same absolute value
- From: Michael Orlitzky <michael at orlitzky dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Thu, 23 Nov 2017 08:52:32 -0500
- Subject: gold linker: rejected multiple definitions with the same absolute value
- Authentication-results: sourceware.org; auth=none
Hello,
When compiling a hardened kernel[0] with CONFIG_PAX_RAP=y and using
ld.gold as my linker, I get the following error (among others similar):
ld: error: init/mounts.o: multiple definition of '__rap_hash_ret_panic'
ld: init/main.o: previous definition here
As it says, the symbol is defined in both places...
$ readelf --symbols init/main.o | grep __rap_hash_ret_panic
415: ffffffff8eba9bf0 0 OBJECT GLOBAL DEFAULT ABS __rap_hash_r...
$ readelf --symbols init/mounts.o | grep __rap_hash_ret_panic
165: ffffffff8eba9bf0 0 OBJECT GLOBAL DEFAULT ABS __rap_hash_r...
But, as you can see, both symbols have equal absolute values. The BFD
linker lets that slide. Is the stricter approach the intended behavior
for ld.gold?
[0] https://github.com/minipli/linux-unofficial_grsec