diff options
-rw-r--r-- | bfd/elf-bfd.h | 27 | ||||
-rw-r--r-- | bfd/elf32-arc.c | 12 | ||||
-rw-r--r-- | bfd/elf32-i386.c | 8 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 9 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 8 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 8 | ||||
-rw-r--r-- | bfd/version.h | 2 | ||||
-rw-r--r-- | gas/config/tc-cr16.c | 3 | ||||
-rw-r--r-- | gas/config/tc-mn10200.c | 5 | ||||
-rw-r--r-- | gas/config/tc-v850.c | 5 | ||||
-rw-r--r-- | gas/config/tc-xgate.c | 2 | ||||
-rw-r--r-- | gas/config/tc-z8k.c | 3 | ||||
-rw-r--r-- | gas/ecoff.c | 3 | ||||
-rw-r--r-- | gas/write.c | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/amd64-disp-step-self-call-alarm.c | 18 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/amd64-disp-step-self-call.S | 23 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/i386-disp-step-self-call-alarm.c | 18 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/i386-disp-step-self-call.S | 23 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/linkonce1.d | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/linkonce3.d | 13 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/no-section-header.exp | 2 |
22 files changed, 88 insertions, 119 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index fbb1cd9..c02e34e 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -3287,25 +3287,20 @@ extern asection _bfd_elf_large_com_section; && ((input_section->flags & SEC_DEBUGGING) != 0 \ || elf_section_type (input_section) == SHT_GNU_SFRAME)) \ { \ - Elf_Internal_Shdr *rel_hdr; \ + Elf_Internal_Shdr *rel_hdr \ + = _bfd_elf_single_rel_hdr (input_section->output_section); \ \ - rel_hdr = _bfd_elf_single_rel_hdr (input_section->output_section); \ + rel_hdr->sh_size -= rel_hdr->sh_entsize; \ + rel_hdr = _bfd_elf_single_rel_hdr (input_section); \ + rel_hdr->sh_size -= rel_hdr->sh_entsize; \ \ - /* Avoid empty output section. */ \ - if (rel_hdr->sh_size > rel_hdr->sh_entsize) \ - { \ - rel_hdr->sh_size -= rel_hdr->sh_entsize; \ - rel_hdr = _bfd_elf_single_rel_hdr (input_section); \ - rel_hdr->sh_size -= rel_hdr->sh_entsize; \ + memmove (rel, rel + count, \ + (relend - rel - count) * sizeof (*rel)); \ \ - memmove (rel, rel + count, \ - (relend - rel - count) * sizeof (*rel)); \ - \ - input_section->reloc_count -= count; \ - relend -= count; \ - rel--; \ - continue; \ - } \ + input_section->reloc_count -= count; \ + relend -= count; \ + rel--; \ + continue; \ } \ \ for (int i_ = 0; i_ < count; i_++) \ diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 0a6e665..a78516d 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -1947,6 +1947,18 @@ elf_arc_relocate_section (bfd * output_bfd, return false; } + if (wrel != rel) + { + Elf_Internal_Shdr *rel_hdr; + size_t deleted = rel - wrel; + + rel_hdr = _bfd_elf_single_rel_hdr (input_section->output_section); + rel_hdr->sh_size -= rel_hdr->sh_entsize * deleted; + rel_hdr = _bfd_elf_single_rel_hdr (input_section); + rel_hdr->sh_size -= rel_hdr->sh_entsize * deleted; + input_section->reloc_count -= deleted; + } + return true; } diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index b417cb0..abe26e4 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -3600,14 +3600,6 @@ elf_i386_relocate_section (bfd *output_bfd, rel_hdr = _bfd_elf_single_rel_hdr (input_section->output_section); rel_hdr->sh_size -= rel_hdr->sh_entsize * deleted; - if (rel_hdr->sh_size == 0) - { - /* It is too late to remove an empty reloc section. Leave - one NONE reloc. - ??? What is wrong with an empty section??? */ - rel_hdr->sh_size = rel_hdr->sh_entsize; - deleted -= 1; - } rel_hdr = _bfd_elf_single_rel_hdr (input_section); rel_hdr->sh_size -= rel_hdr->sh_entsize * deleted; input_section->reloc_count -= deleted; diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index f17effd..3fd9f28 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -9142,15 +9142,6 @@ ppc_elf_relocate_section (bfd *output_bfd, rel_hdr = _bfd_elf_single_rel_hdr (input_section->output_section); rel_hdr->sh_size -= rel_hdr->sh_entsize * deleted; - if (rel_hdr->sh_size == 0) - { - /* It is too late to remove an empty reloc section. Leave - one NONE reloc. - ??? What is wrong with an empty section??? */ - rel_hdr->sh_size = rel_hdr->sh_entsize; - deleted -= 1; - wrel++; - } relend = wrel; rel_hdr = _bfd_elf_single_rel_hdr (input_section); rel_hdr->sh_size -= rel_hdr->sh_entsize * deleted; diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 00c1c32..e6c90a6 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -18082,14 +18082,6 @@ ppc64_elf_relocate_section (bfd *output_bfd, rel_hdr = _bfd_elf_single_rel_hdr (input_section->output_section); rel_hdr->sh_size -= rel_hdr->sh_entsize * deleted; - if (rel_hdr->sh_size == 0) - { - /* It is too late to remove an empty reloc section. Leave - one NONE reloc. - ??? What is wrong with an empty section??? */ - rel_hdr->sh_size = rel_hdr->sh_entsize; - deleted -= 1; - } rel_hdr = _bfd_elf_single_rel_hdr (input_section); rel_hdr->sh_size -= rel_hdr->sh_entsize * deleted; input_section->reloc_count -= deleted; diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index ebd2eb4..b6f97b5 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -5099,14 +5099,6 @@ elf_x86_64_relocate_section (bfd *output_bfd, rel_hdr = _bfd_elf_single_rel_hdr (input_section->output_section); rel_hdr->sh_size -= rel_hdr->sh_entsize * deleted; - if (rel_hdr->sh_size == 0) - { - /* It is too late to remove an empty reloc section. Leave - one NONE reloc. - ??? What is wrong with an empty section??? */ - rel_hdr->sh_size = rel_hdr->sh_entsize; - deleted -= 1; - } rel_hdr = _bfd_elf_single_rel_hdr (input_section); rel_hdr->sh_size -= rel_hdr->sh_entsize * deleted; input_section->reloc_count -= deleted; diff --git a/bfd/version.h b/bfd/version.h index f200fb8..5537911 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20250718 +#define BFD_VERSION_DATE 20250719 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c index 99bc1bd..f2d1108 100644 --- a/gas/config/tc-cr16.c +++ b/gas/config/tc-cr16.c @@ -119,7 +119,6 @@ const size_t md_longopts_size = sizeof (md_longopts); static void l_cons (int nbytes) { - int c; expressionS exp; #ifdef md_flush_pending_output @@ -141,7 +140,6 @@ l_cons (int nbytes) md_cons_align (nbytes); #endif - c = 0; do { unsigned int bits_available = BITS_PER_CHAR * nbytes; @@ -236,7 +234,6 @@ l_cons (int nbytes) if ((*(input_line_pointer) == '@') && (*(input_line_pointer +1) == 'c')) code_label = 1; emit_expr (&exp, nbytes); - ++c; if ((*(input_line_pointer) == '@') && (*(input_line_pointer +1) == 'c')) { input_line_pointer +=3; diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c index 1eb4702..fe54d21 100644 --- a/gas/config/tc-mn10200.c +++ b/gas/config/tc-mn10200.c @@ -896,7 +896,6 @@ md_assemble (char *str) for (;;) { const char *errmsg = NULL; - int op_idx; char *hold; int extra_shift = 0; @@ -906,9 +905,9 @@ md_assemble (char *str) next_opindex = 0; insn = opcode->opcode; extension = 0; - for (op_idx = 1, opindex_ptr = opcode->operands; + for (opindex_ptr = opcode->operands; *opindex_ptr != 0; - opindex_ptr++, op_idx++) + opindex_ptr++) { const struct mn10200_operand *operand; expressionS ex; diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c index f73c3bf..176910d 100644 --- a/gas/config/tc-v850.c +++ b/gas/config/tc-v850.c @@ -344,15 +344,10 @@ v850_comm (int area) int old_subsec; char *pfrag; int align; - flagword applicable; old_sec = now_seg; old_subsec = now_subseg; - applicable = bfd_applicable_section_flags (stdoutput); - - applicable &= SEC_ALLOC; - switch (area) { case SCOMMON_SECTION: diff --git a/gas/config/tc-xgate.c b/gas/config/tc-xgate.c index 0823ecd..4a7829f 100644 --- a/gas/config/tc-xgate.c +++ b/gas/config/tc-xgate.c @@ -1123,7 +1123,6 @@ xgate_scan_operands (struct xgate_opcode *opcode, s_operand oprs[]) unsigned short oper_mask = 0; int operand_bit_length = 0; unsigned int operand = 0; - char n_operand_bits = 0; char first_operand_equals_second = 0; int i = 0; char c = 0; @@ -1139,7 +1138,6 @@ xgate_scan_operands (struct xgate_opcode *opcode, s_operand oprs[]) { oper_mask <<= 1; oper_mask += 1; - n_operand_bits++; } } diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c index 2980cff..83a732f 100644 --- a/gas/config/tc-z8k.c +++ b/gas/config/tc-z8k.c @@ -1032,7 +1032,6 @@ build_bytes (opcode_entry_type *this_try, struct z8k_op *operand ATTRIBUTE_UNUSE { unsigned char *output_ptr = buffer; int c; - int nibble; unsigned int *class_ptr; frag_wane (frag_now); @@ -1044,7 +1043,7 @@ build_bytes (opcode_entry_type *this_try, struct z8k_op *operand ATTRIBUTE_UNUSE memset (buffer, 0, sizeof (buffer)); class_ptr = this_try->byte_info; - for (nibble = 0; (c = *class_ptr++); nibble++) + while ((c = *class_ptr++) != 0) { switch (c & CLASS_MASK) diff --git a/gas/ecoff.c b/gas/ecoff.c index 7411595..97b9093 100644 --- a/gas/ecoff.c +++ b/gas/ecoff.c @@ -3606,7 +3606,6 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend, efdr_t *file; proc_t *proc; unsigned long c; - long iline; long totcount; lineno_list_t first; lineno_list_t *local_first_lineno = first_lineno; @@ -3620,7 +3619,6 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend, proc = NULL; last = NULL; c = offset; - iline = 0; totcount = 0; /* FIXME? Now that MIPS embedded-PIC is gone, it may be safe to @@ -3800,7 +3798,6 @@ ecoff_build_lineno (const struct ecoff_debug_swap *backend, ++c; } - ++iline; last = l; } diff --git a/gas/write.c b/gas/write.c index 455dc44..c56ad28 100644 --- a/gas/write.c +++ b/gas/write.c @@ -2242,7 +2242,7 @@ write_object_file (void) char *table_ptr; addressT table_addr; addressT from_addr, to_addr; - int n, m; + int n; subseg_change (lie->seg, lie->subseg); fragP = lie->dispfrag; @@ -2267,9 +2267,9 @@ write_object_file (void) table_ptr += md_short_jump_size; table_addr += md_short_jump_size; - for (m = 0; + for (; lie && lie->dispfrag == fragP; - m++, lie = lie->next_broken_word) + lie = lie->next_broken_word) { if (lie->added == 2) continue; diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call-alarm.c b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call-alarm.c index 03b868c..0fb2904 100644 --- a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call-alarm.c +++ b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call-alarm.c @@ -16,9 +16,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <unistd.h> +#include <stdlib.h> + +extern void test_call (void); + +void +unreachable (void) +{ + abort (); +} void setup_alarm (void) { alarm (300); } + +int +main () +{ + setup_alarm (); + test_call (); + unreachable (); + return 0; +} diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.S b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.S index 78a6859..20a8eb7 100644 --- a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.S +++ b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.S @@ -18,33 +18,12 @@ handling. */ .text - - .global main -main: - nop - - callq setup_alarm - - nop - -/***********************************************/ - -/* test call/ret */ - .global test_call test_call: call test_call - nop + call unreachable .global test_ret_end test_ret_end: nop -/***********************************************/ - -/* all done */ - -done: - mov $0,%rdi - call exit - hlt .section .note.GNU-stack,"",@progbits diff --git a/gdb/testsuite/gdb.arch/i386-disp-step-self-call-alarm.c b/gdb/testsuite/gdb.arch/i386-disp-step-self-call-alarm.c index 03b868c..0fb2904 100644 --- a/gdb/testsuite/gdb.arch/i386-disp-step-self-call-alarm.c +++ b/gdb/testsuite/gdb.arch/i386-disp-step-self-call-alarm.c @@ -16,9 +16,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <unistd.h> +#include <stdlib.h> + +extern void test_call (void); + +void +unreachable (void) +{ + abort (); +} void setup_alarm (void) { alarm (300); } + +int +main () +{ + setup_alarm (); + test_call (); + unreachable (); + return 0; +} diff --git a/gdb/testsuite/gdb.arch/i386-disp-step-self-call.S b/gdb/testsuite/gdb.arch/i386-disp-step-self-call.S index 466e50c..20a8eb7 100644 --- a/gdb/testsuite/gdb.arch/i386-disp-step-self-call.S +++ b/gdb/testsuite/gdb.arch/i386-disp-step-self-call.S @@ -18,33 +18,12 @@ handling. */ .text - - .global main -main: - nop - - call setup_alarm - - nop - -/***********************************************/ - -/* test call/ret */ - .global test_call test_call: call test_call - nop + call unreachable .global test_ret_end test_ret_end: nop -/***********************************************/ - -/* all done */ - -done: - pushl $0 - call exit - hlt .section .note.GNU-stack,"",@progbits diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index f9039dc..8d94d6b 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -9993,6 +9993,10 @@ proc gdb_stdin_log_init { } { set logfile [standard_output_file_with_gdb_instance gdb.in] set in_file [open $logfile w] + + verbose -log "" + verbose -log "Starting logfile: $logfile" + verbose -log "" } # Write to the file for logging gdb input. diff --git a/ld/testsuite/ld-elf/linkonce1.d b/ld/testsuite/ld-elf/linkonce1.d index e4f9a70..3920f25 100644 --- a/ld/testsuite/ld-elf/linkonce1.d +++ b/ld/testsuite/ld-elf/linkonce1.d @@ -2,11 +2,10 @@ #source: linkonce1b.s #ld: -r #objdump: -r +#notarget: [is_generic] .*: file format .* #... -RELOCATION RECORDS FOR \[.debug_frame\]: -OFFSET[ ]+TYPE[ ]+VALUE[ ]* -.*(NONE|unused|UNUSED).*\*ABS\* +RELOCATION RECORDS FOR \[.debug_frame\]: \(none\) #pass diff --git a/ld/testsuite/ld-elf/linkonce3.d b/ld/testsuite/ld-elf/linkonce3.d new file mode 100644 index 0000000..25306d2 --- /dev/null +++ b/ld/testsuite/ld-elf/linkonce3.d @@ -0,0 +1,13 @@ +#source: linkonce1a.s +#source: linkonce1b.s +#ld: -r +#objdump: -r +#target: [is_generic] + +.*: file format .* +#... +RELOCATION RECORDS FOR \[.debug_frame\]: +OFFSET[ ]+TYPE[ ]+VALUE[ ]* +.*(NONE|unused|UNUSED).*\*ABS\* + +#pass diff --git a/ld/testsuite/ld-elf/no-section-header.exp b/ld/testsuite/ld-elf/no-section-header.exp index 2a4575b..7461fdd 100644 --- a/ld/testsuite/ld-elf/no-section-header.exp +++ b/ld/testsuite/ld-elf/no-section-header.exp @@ -21,7 +21,7 @@ # Written by H.J. Lu (hongjiu.lu@intel.com) # -if { ![is_elf_format] } { +if { ![istarget *-*-gnu*] } { return } |