This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[ld] build_link_order question
- From: Gunther Nikl <gnikl at justmail dot de>
- To: binutils <binutils at sourceware dot org>
- Date: Tue, 10 Apr 2018 18:14:39 +0200
- Subject: [ld] build_link_order question
Hello,
I am using an out-of-tree a.out target (m68k-amigaos). When placing
the (a.out?) COMMON section into a .data output section the link fails
in aoutx.h/get_reloc_upper_bound with "bfd_error_invalid_operation".
AFAICT, this is because ld creates a link_order statement since the
output section ".data" has contents. That is contrary to the usual
destination ".bss" where SEC_HAS_CONTENTS is not set. Is this a
limitation of ldwrite.c:build_link_order/lang_input_section_enum?
For a test I added a check there that catches input sections without
contents to not create a link order. Then the link succeeds. Is this
a proper solution?
Regards,
Gunther Nikl