[PATCH] Don't attempt to place symbols into a discarded .dynsym
Wed Oct 3 21:27:00 GMT 2018
I would like to propose a patch to fix an error we see while linking the
To meet the needs of different tools, we are compiling the kernel with
-ffunction-sections -fdata-sections and link it with --emit-relocs. That
increases the total number of sections. As a result, we trigger the
error within check_dynsym, regarding dynamic symbols in sections with
indices higher than 64K. However, I believe the error is invalid because
the kernel already discards .dynsym in its linker script.
The attached patch prevents putting dynamic symbols into a discarded
.dynsym; therefore, it avoids the error message regarding dynamic
symbols when .dynsym is discarded. The resulting linker can build the
kernel under the above-mentioned conditions.
This patch does not intend to change the output of previously-successful
linker runs: a) If the .dynsym is not discarded, the patch does not take
effect. b) When it's discarded, the contents of the .dynsym are not
output either way. Therefore, the changes made by this patch is not
visible in the output.
The patch is tested on x86_64-pc-linux-gnu and aarch64-unknown-linux-gnu
and introduced no regressions. Although, I doubt if there's a test case
where .dynsym is discarded.
The following is the proposed bfd/ChangeLog entry:
2018-10-03Â Egeyar BagciogluÂ <email@example.com>
Â Â Â * elflink.c (elf_link_output_extsym): Do not attempt to place symbols
Â Â Â into a discarded .dynsym.
Please take a look and apply if legitimate.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 841 bytes
Desc: not available
More information about the Binutils