This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld fails to handle empty group sections
- From: Alan Modra <amodra at gmail dot com>
- To: Pierre Lebleu <pme dot lebleu at gmail dot com>
- Cc: dedeckeh at gmail dot com, binutils at sourceware dot org
- Date: Sat, 8 Jul 2017 12:52:07 +0930
- Subject: ld fails to handle empty group sections
- Authentication-results: sourceware.org; auth=none
- References: <CAF+EMyfQBweOWBdf-u=off9-X5d=4e=DETjAjYXHku8L2Gw-3Q@mail.gmail.com>
Hi Pierre,
Please ask questions like this on the mailing list. Someone wrote
quite a good list of reasons why you should do this. See:
https://www.eyrie.org/~eagle/faqs/questions.html
On Fri, Jul 07, 2017 at 10:44:14AM +0200, Pierre Lebleu wrote:
> With the "trunk" version, I got this message :
[snip]
> staging_dir/toolchain-mips_mips32_gcc-5.3.0_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-ld:
> /usr/localdisk/vant-f_5.02/openwrt/build_dir/target-mips_mips32_uClibc-0.9.33.2/linux-brcm63xx-tch_VANTF/paragon-9.4.4/ifslinux/ufsd.o:
> SHT_GROUP section [index 110] has no SHF_GROUP sections
[snip]
> The problem seems to be those *empty* GROUP sections :
> COMDAT group section [ 110] `.group'
> [wm4.prealloc.h.7.3f44507fe709a4206e0a16687993bc55] contains 0 sections:
> [Index] Name
Right. How is the ufsd.o file being generated? Strictly speaking, I
don't think there is anything in the ELF gABI that precludes an emtpy
group, but such a construct is useless. Rather than modifying the
linker to deal with them, I'd rather they weren't created in the first
place. If the problem is some objcopy or ld -r linking stage that
removes sections, then it is probably better to remove empty groups at
that point rather than trying to deal with them later.
--
Alan Modra
Australia Development Lab, IBM