if ((sec->flags & SEC_LINKER_CREATED) && cookie->rels == NULL)
return true;
- BFD_ASSERT (cookie->rels + fde_count == cookie->relend);
rel = cookie->rels;
for (i = 0; i < fde_count; i++)
{
rel++;
}
+ /* If there are more relocation entries, they must be R_*_NONE which
+ may be generated from relocations against discarded sections by
+ ld -r. */
+ for (; rel < cookie->relend; rel++)
+ if (rel->r_info != 0)
+ break;
+ BFD_ASSERT (rel == cookie->relend);
+
return true;
}
--- /dev/null
+ .section sect, "axG", @progbits, sectgroup, comdat
+ .global _start
+_start:
+ .cfi_startproc
+ call foo
+ .cfi_endproc
+ .section .note.GNU-stack,"",@progbits
--- /dev/null
+ .section sect, "axG", @progbits, sectgroup, comdat
+ .cfi_startproc
+# Test intention is that LSDA must be provided by the discarded FDE.
+# DW_EH_PE_udata8 = 4
+# DW_EH_PE_udata4 = 3
+ .ifdef ELF64
+ .cfi_lsda 4, lsda
+ .else
+ .cfi_lsda 3, lsda
+ .endif
+ .skip 16
+ .cfi_endproc
+
+ .text
+ .globl foo
+ .type foo, @function
+foo:
+ .cfi_startproc
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset 6, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register 6
+ popq %rbp
+ .cfi_def_cfa 7, 8
+ ret
+ .cfi_endproc
+
+ .section .gcc_except_table, "a", @progbits
+lsda:
+ .section .note.GNU-stack,"",@progbits
run_dump_test "sframe-ibt-plt-1"
run_dump_test "sframe-pltgot-1"
run_dump_test "sframe-pltgot-2"
+
+ run_ld_link_tests [list \
+ [list \
+ "Build sframe-reloc-2.o" \
+ "-m elf_x86_64 -r" \
+ "" \
+ "--64 --gsframe" \
+ {sframe-reloc-2a.s sframe-reloc-2b.s} \
+ "" \
+ "sframe-reloc-2.o" \
+ ] \
+ [list \
+ "Build sframe-reloc-2" \
+ "-m elf_x86_64 tmpdir/sframe-reloc-2.o" \
+ "" \
+ "--64 --gsframe" \
+ {dummy.s} \
+ "" \
+ "sframe-reloc-2" \
+ ] \
+ ]
}
if ![istarget "x86_64-*-linux*"] {