gold linker: rejected multiple definitions with the same absolute value
Michael Orlitzky
michael@orlitzky.com
Thu Nov 23 13:52:00 GMT 2017
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
More information about the Binutils
mailing list