diff options
author | Alan Modra <amodra@gmail.com> | 2021-09-22 09:04:00 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-09-22 10:24:05 +0930 |
commit | cf11ebea1206a7c459a94fef8e0880087dd9f38f (patch) | |
tree | 40ac307ae5a4110f0516a5e19b43e65c81bd7d2a /gas/config | |
parent | ed41b9cdb293630d57d294d756f8d08b0cff983d (diff) | |
download | fsf-binutils-gdb-cf11ebea1206a7c459a94fef8e0880087dd9f38f.zip fsf-binutils-gdb-cf11ebea1206a7c459a94fef8e0880087dd9f38f.tar.gz fsf-binutils-gdb-cf11ebea1206a7c459a94fef8e0880087dd9f38f.tar.bz2 |
dwarf2 sub-section test
This is a testcase for the bug fixed by commit 5b4846283c3d. When
running the testcase on ia64 targets I found timeouts along with lots
of memory being consumed, due to ia64 gas not tracking text
sub-sections. Trying to add nops for ".nop 16" in ".text 1" resulting
in them being added to subsegment 0, with no increase to subsegment 1
size. This patch also fixes that problem.
Note that the testcase fails on ft32-elf, mn10200-elf, score-elf,
tic5x-elf, and xtensa-elf. The first two are relocation errors, the
last three appear to be the .nop directive failing to emit the right
number of nops. I didn't XFAIL any of them.
* config/tc-ia64.c (md): Add last_text_subseg.
(ia64_flush_insns, dot_endp): Use last_text_subseg.
(ia64_frob_label, md_assemble): Set last_text_subseg.
* testsuite/gas/elf/dwarf2-21.d,
* testsuite/gas/elf/dwarf2-21.s: New test.
* testsuite/gas/elf/elf.exp: Run it.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-ia64.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index 4fc0c56..4fa7f76 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -306,6 +306,7 @@ static struct slot[NUM_SLOTS]; segT last_text_seg; + subsegT last_text_subseg; struct dynreg { @@ -952,7 +953,7 @@ ia64_flush_insns (void) saved_seg = now_seg; saved_subseg = now_subseg; - subseg_set (md.last_text_seg, 0); + subseg_set (md.last_text_seg, md.last_text_subseg); while (md.num_slots_in_use > 0) emit_one_bundle (); /* force out queued instructions */ @@ -4410,7 +4411,7 @@ dot_endp (int dummy ATTRIBUTE_UNUSED) { symbolS *proc_end; - subseg_set (md.last_text_seg, 0); + subseg_set (md.last_text_seg, md.last_text_subseg); proc_end = expr_build_dot (); start_unwind_section (saved_seg, SPECIAL_SECTION_UNWIND); @@ -7767,6 +7768,7 @@ ia64_frob_label (struct symbol *sym) if (bfd_section_flags (now_seg) & SEC_CODE) { md.last_text_seg = now_seg; + md.last_text_subseg = now_subseg; fix = XOBNEW (¬es, struct label_fix); fix->sym = sym; fix->next = CURR_SLOT.label_fixups; @@ -10854,6 +10856,7 @@ md_assemble (char *str) insn_group_break (1, 0, 0); md.last_text_seg = now_seg; + md.last_text_subseg = now_subseg; done: input_line_pointer = saved_input_line_pointer; |