https://sourceware.org/bugzilla/show_bug.cgi?id=17666
Bug ID: 17666 Summary: ld -r may create reloc sections with unordered relocs Product: binutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: amodra at gmail dot com cat > text1.s <<EOF .section ".text1","ax",%progbits .L1: .dc.a .L2 .data .L2: .dc.a .L1 EOF cat > text.s <<EOF .text .L1: .dc.a .L2 .data .L2: .dc.a .L1 EOF as -o text1.o text1.s as -o text.o text.s # remove empty sections objcopy -R .text -R .bss text1.o objcopy -R .bss text.o ld -r -o out.o text1.o text.o objdump -r -j.data out.o shows .data relocs out of order. This bug is caused by elflink.c processing text1.o first due to this loop: for (o = abfd->sections; o != NULL; o = o->next) { for (p = o->map_head.link_order; p != NULL; p = p->next) { if (p->type == bfd_indirect_link_order && (bfd_get_flavour ((sub = p->u.indirect.section->owner)) == bfd_target_elf_flavour) && elf_elfheader (sub)->e_ident[EI_CLASS] == bed->s->elfclass) { if (! sub->output_has_begun) { if (! elf_link_input_bfd (&flinfo, sub)) goto error_return; sub->output_has_begun = TRUE; } and the fact that reloc sections are not placed by the generic linker. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils