aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-08-31PR26493 UBSAN: elfnn-riscv.c left shift of negative valueAlan Modra4-7/+20
include/ PR 26493 * opcode/riscv.h (OP_MASK_CSR, OP_MASK_CUSTOM_IMM) (OP_MASK_FUNCT7, OP_MASK_RS3): Make unsigned. bfd/ PR 26493 * elfnn-riscv.c (riscv_make_plt_header): Cast PLT_HEADER_SIZE to unsigned when using with RISCV_ITYPE. (_bfd_riscv_relax_call): Use an unsigned foff.
2020-08-31PR26476, PR26477 UBSAN: elfxx-mips.c:2695,5370 cannot be representedAlan Modra2-5/+14
PR 26476 PR 26477 * elfxx-mips.c (CRINFO_CTYPE, CRINFO_RTYPE, CRINFO_DIST2TO), (CRINFO_RELVADDR): Make unsigned. (mips_elf_nullify_got_load): Use unsigned constant when shifting into sign bit.
2020-08-31PR26466 UBSAN: elf32-mep.c:300 left shift of negative valueAlan Modra3-50/+57
PR 26466 * mep-relocs.pl (emit_apply): Handle HI16S adjustment. Use "u" variable and rewrite signed overflow check. * elf32-mep.c: Regenerate. (mep_final_link_relocate): Delete "s".
2020-08-31PR26461 UBSAN: elfxx-ia64.c:747 cannot be representedAlan Modra2-3/+9
PR 26461 * elfxx-ia64.c (ia64_elf_install_value): Make expressions unsigned that might shift values into sign bit.
2020-08-31PR26457 UBSAN: som.c:1794 left shift cannot be representedAlan Modra2-14/+26
PR 26457 * som/aout.h (SOM_SUBSPACE_ACCESS_CONTROL_BITS_MASK): Make unsigned. (SOM_SUBSPACE_MEMORY_RESIDENT, SOM_SUBSPACE_DUP_COMMON) (SOM_SUBSPACE_IS_COMMON, SOM_SUBSPACE_IS_LOADABLE) (SOM_SUBSPACE_QUADRANT_MASK, SOM_SUBSPACE_INITIALLY_FROZEN) (SOM_SUBSPACE_IS_FIRST, SOM_SUBSPACE_CODE_ONLY) (SOM_SUBSPACE_SORT_KEY_MASK, SOM_SUBSPACE_REPLICATE_INIT) (SOM_SUBSPACE_CONTINUATION, SOM_SUBSPACE_IS_TSPECIFIC) (SOM_SUBSPACE_IS_COMDAT): Likewise.
2020-08-31PR26445 UBSAN: elf32-csky.c:4115 left shift of negative valueAlan Modra2-12/+18
PR 26445 * elf32-csky.c (csky_relocate_contents): Make relocation a bfd_vma, and similarly for variables dealing with overflow.
2020-08-31crx: ubsan: cannot be representedAlan Modra3-128/+116
* config/tc-crx.c: Formatting. (CRX_PRINT): Wrap params in parentheses. Remove parens from uses throughout file. (reset_vars, get_register, get_copregister, get_optype, get_opbits), (get_opflags, get_number_of_operands, parse_operand, gettrap), (handle_LoadStor, getconstant, check_range, getreg_image), (parse_operands, parse_insn, print_operand, print_constant), (exponent2scale, mask_reg, process_label_constant, set_operand), (assemble_insn, print_insn): Delete unnecessary forward declaration. (print_insn): Make static. (print_constant): Make "constant" unsigned. (assemble_insn): Tidy REVERSE_MATCH index calc. * expr.c (generic_bignum_to_int32): Cast elements to valueT.
2020-08-31PR26442 UBSAN: elf32-crx.c:512 cannot be represented in intAlan Modra2-14/+13
PR 26442 * elf32-crx.c (crx_elf_final_link_relocate): Calculate reloc_bits without undefined behaviour. Tidy excess casts.
2020-08-31PR26509 UBSAN: tc-z80.c:3656 shift exponent is too largeAlan Modra2-1/+6
PR 26509 * config/tc-z80.c (is_overflow): Use 1UL in mask shift expression.
2020-08-31mn10300: ubsan: shift exponent too largeAlan Modra2-8/+16
* elf-m10300.c (mn10300_elf_relax_delete_bytes): Calculate alignment from reloc addend after reloc type R_MN10300_ALIGN is found.
2020-08-31tic4x-coff: ubsan: various shift UBAlan Modra2-10/+12
* config/tc-tic4x.c (tic4x_gen_to_words): Rewrite mantissa overflow test without UB. Avoid other UB shifts by making them unsigned.
2020-08-31[gdb/testsuite] Add nopie to gdb.base/eh_return.expTom de Vries2-1/+6
When running test-case gdb.base/eh_return.exp with target board unix/-fPIE/-pie, we run into: ... (gdb) break *0x88e^M Breakpoint 1 at 0x88e: file eh_return.c, line 54.^M (gdb) PASS: gdb.base/eh_return.exp: setting breakpoint at *0x88e run ^M Starting program: eh_return ^M Warning:^M Cannot insert breakpoint 1.^M Cannot access memory at address 0x88e^M ^M (gdb) FAIL: gdb.base/eh_return.exp: hit breakpoint ... The problem is that gdb does not support setting breakpoints on unrelocated addresses. Fix this by using nopie for the test-case. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-08-31 Tom de Vries <tdevries@suse.de> * gdb.base/eh_return.exp: Use nopie.
2020-08-31CSKY: Refine operand format error reporting.Cooper Qu4-109/+214
Rename SET_ERROR_NUMBER to SET_ERROR_STRING, and add SET_ERROR_INTEGER to report error message which pass an integer argument. gas/ * config/tc-csky.c (csky_error_state): New member 'arg_int'. (SET_ERROR_NUMBER): Rename to SET_ERROR_STRING. (SET_ERROR_INTEGER): New. (err_formats): Add error format for ERROR_FREG_OVER_RANGE and ERROR_VREG_OVER_RANGE. (csky_show_error): Pass an integer argument for some error numbers. (parse_exp): Call SET_ERROR_STRING instead of SET_ERROR_NUMBER. (parse_rt): Likewise. (parse_type_ctrlreg): Likewise. (csky_get_reg_val): Likewise. (is_reglist_legal): Likewise. (is_freglist_legal): Likewise. (is_reglist_dash_comma_legal): Likewise. (is_reg_lshift_illegal): Likewise. (is_psr_bit): Likewise. (parse_type_cpreg): Likewise. (parse_type_cpcreg): Likewise. (parse_type_areg): Likewise. (parse_type_freg): Likewise. (parse_ldst_imm): Likewise and call SET_ERROR_INTEGER. (get_operand_value): Likewise. (parse_operands_op): Likewise and call is_imm_within_range, is_imm_within_range_ext and is_oimm_within_range. (md_assemble): Likewise. (is_imm_within_range): New. (is_imm_within_range_ext): Rename from is_imm_over_range. (is_oimm_within_range): Rename from is_oimm_over_range. (v2_work_add_sub): Call SET_ERROR_INTEGER. (csky_rolc): call is_imm_within_range instead of is_imm_over_range. opcodes/ * csky-dis.c (csky_output_operand): Assign dis_info.value for OPRND_TYPE_VREG.
2020-08-31CSKY: Add warning when -mdsp and -mcpu=ck803ern are both added.Cooper Qu2-3/+22
gas/ * config/tc-csky.c (md_begin): Add warning when -mdsp and -mcpu=ck803ern are both added. (parse_ldst_imm): Fix error message.
2020-08-31Automatic date update in version.inGDB Administrator1-1/+1
2020-08-30ld: Add $NOSANTIZE_CFLAGS to more linker testsH.J. Lu6-9/+33
* testsuite/ld-elf/dwarf.exp: Append $NOSANTIZE_CFLAGS to CFLAGS. * testsuite/ld-elf/shared.exp: Likewise. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-shared/shared.exp: Likewise. * testsuite/ld-size/size.exp: Likewise.
2020-08-30changelog PR fixAlan Modra1-2/+2
for the lack of a space
2020-08-30readelf: ubsan: shift exponent 32 is too largeAlan Modra2-1/+6
When compiled on a 32-bit host, a temp var is too small for possible 64-bit values to be calculated. * readelf.c (print_gnu_build_attribute_name): Make "bytes" unsigned long long.
2020-08-30cr16 disassembly error of disp20 fieldsAlan Modra11-118/+126
When looking at the UB errors, I noticed that cbitb_test.d disassembly wasn't reproducing the input assembly. That turned out to be an error in make_argument case arg_cr. This fixes that and makes some general tidies. opcodes/ * cr16-dis.c: Formatting. (parameter): Delete struct typedef. Use dwordU instead throughout file. (make_argument <arg_idxr>): Simplify detection of cbitb, sbitb and tbitb. (make_argument <arg_cr>): Extract 20-bit field not 16-bit. gas/ * testsuite/gas/cr16/cbitb_test.d: Update expected output. * testsuite/gas/cr16/cbitw_test.d: Likewise. * testsuite/gas/cr16/sbitb_test.d: Likewise. * testsuite/gas/cr16/sbitw_test.d: Likewise. * testsuite/gas/cr16/storb_test.d: Likewise. * testsuite/gas/cr16/storw_test.d: Likewise. * testsuite/gas/cr16/tbitb_test.d: Likewise. * testsuite/gas/cr16/tbitw_test.d: Likewise.
2020-08-30PR26437, PR26438 UBSAN: tc-cr16.c left shifts and overflowsAlan Modra2-801/+799
Always use unsigned constants in expressions generating masks. The following trys mightily to avoid UB (but hits it anyway with bits=32 and 0x7fffffff << 1), and worse, for 32-bit int, 64-bit long, bits=32 doesn't generate 0xffffffff. max = ((((1 << (bits - 1)) - 1) << 1) | 1); results in -1, or max = 0xffffffffffffffff. This patch fixes that problem, a possible shift exponent of -1U, removes some dead code, and makes general tidies. PR26437 PR26438 * config/tc-cr16.c: Include limits.h, formatting. (CR16_PRINT): Wrap params in parentheses. Remove parens from uses throughout file. (getconstant): Handle zero nbits. (print_operand): Simplify handling of index regs. (check_range): Use int32_t variables. Correct range checks.
2020-08-30PR26435, PR26436 UBSAN: elf32-cr16.c:928 left shiftAlan Modra2-4/+8
PR 26435 PR 26436 * elf32-cr16.c (cr16_elf_final_link_relocate): Calculate reloc_bits without undefined behaviour.
2020-08-30Automatic date update in version.inGDB Administrator1-1/+1
2020-08-29Include members in the variable table used when resolving ↵Nick Clifton2-2/+9
DW_AT_specification tags. PR 26520 * dwarf2.c (scan_unit_for_symbols): Add member entries to the variable table.
2020-08-29correct pr number in changelogAlan Modra1-1/+1
2020-08-29PR26446 UBSAN: tc-csky.c:2618,4022 index out of boundsAlan Modra2-2/+8
PR 26446 * csky-opc.h (MAX_OPRND_NUM): Define to 5. (union csky_operand): Use MAX_OPRND_NUM to size oprnds array.
2020-08-29PR26481 UBSAN: tc-pj.c:281 index out of boundsAlan Modra2-2/+8
PR 26481 * config/tc-pj.c (md_assemble): Don't loop past end of opcode->arg array.
2020-08-29PR26459 UBSAN: elfnn-ia64.c:1945 null pointer bsearchAlan Modra2-19/+27
PR 26495 * elfnn-ia64.c (get_dyn_sym_info): Don't bsearch or look at last element when count is zero. bfd_realloc when shrinking.
2020-08-29Automatic date update in version.inGDB Administrator1-1/+1
2020-08-29Adjust "maint info program-spaces" to per-inferior target stackPedro Alves2-2/+13
By inspection, I noticed that print_program_space is calling target_pid_to_str on the wrong target stack. Most targets print a process pid the same way, so it isn't actually visible. gdb/ChangeLog: * progspace.c (print_program_space): Use all_inferiors. Switch to the inferior before calling target_pid_to_str.
2020-08-28Fix gdb.base/advance-until-multiple-locations.exp with some compilersPedro Alves2-2/+8
The tests in gdb.base/advance-until-multiple-locations.exp that expect the program to stop at a caller fail on some systems, depending on compiler. E.g., with Clang 10, I see: advance ovld_func 0x00000000004011a3 in test () at /home/pedro/gdb/binutils-gdb/src/gdb/testsuite/gdb.base/advance-until-multiple-locations.cc:51 51 ovld_func (); (gdb) FAIL: gdb.base/advance-until-multiple-locations.exp: advance_overload: second advance stops at caller And Tom de Vries saw: ... (gdb) until ovld_func^M main () at advance-until-multiple-locations.cc:61^M 61 }^M (gdb) FAIL: gdb.base/advance-until-multiple-locations.exp:until_overload: until ovld_func ... Which exact line the program stops is not important. All we care about here is that the program stopped at the caller function. So fix it by adjusting the patterns to match the frame header/function reported by the breakpoint hits instead of the source lines text. Tested against: - gcc {4.8, 4.9, 7.3.1, 9.3.0, trunk-20200828} - clang {5.0.2, 10} gdb/testsuite/ChangeLog: * gdb.base/advance-until-multiple-locations.exp (advance_overload, until_overload): Adjust to match the frame/function header instead of the source line text.
2020-08-28Fix two out-of-date commentsTom Tromey3-4/+7
While looking at psymtabs again, I noticed a couple of outdated comments. These days, psymtabs can be destroyed, as they are no longer obstack-allocated. gdb/ChangeLog 2020-08-28 Tom Tromey <tom@tromey.com> * xcoffread.c (xcoff_end_psymtab): Update comment. * dbxread.c (dbx_end_psymtab): Update comment.
2020-08-28Fix a bogus error message from the DWARF LEB129 decoder when trying to read ↵Nick Clifton2-7/+27
a signed LEB128 value containing the largest possible signed negative integer value. PR 26548 * dwarf.c (read_leb128): When checking for overflow of a signed read, use a signed shift.
2020-08-28PR26449, PR26450 UBSAN: frv-ibld.c:135 left shiftAlan Modra16-90/+133
Eh well, I guess the code didn't quite live up to the comment. PR 26449 PR 26450 * cgen-ibld.in (insert_1): Use 1UL in forming mask. (extract_normal): Likewise. (insert_normal): Likewise, and move past zero length test. (put_insn_int_value): Handle mask for zero length, use 1UL. * bpf-ibld.c, * epiphany-ibld.c, * fr30-ibld.c, * frv-ibld.c, * ip2k-ibld.c, * iq2000-ibld.c, * lm32-ibld.c, * m32c-ibld.c, * m32r-ibld.c, * mep-ibld.c, * mt-ibld.c, * or1k-ibld.c, * xc16x-ibld.c, * xstormy16-ibld.c: Regenerate.
2020-08-28PR26460 UBSAN: tc-ia64.c:6107 index out of boundsAlan Modra2-2/+10
PR 26460 * config/tc-ia64.c (parse_operands): Don't access past end of idesc->operands.
2020-08-28PR26418 UBSAN: cache.c:386 null pointer fwriteAlan Modra2-2/+8
And some more. PR 26418 * ecofflink.c (bfd_ecoff_write_accumulated_debug): Don't write zero size buffers.
2020-08-28gas: Handle bad -gdwarf options, just like bad --gdwarf options.Mark Wielaard2-0/+11
parse_args uses getopt_long_only so it can handle long options both with double and single dash. But this means that some single dash options like -gdwarf-1 don't generate an error (unlike --gdwarf-1). This is especially confusing since there is also --gdwarf2, but no --gdwarf4 (it is --gdwarf-4). When giving -gdwarf4 the option is silently interpreted as -g (which set dwarf_version to 2). This causes some confusion for people who don't expect this and suddenly get DWARF2 instead of DWARF4 as they might expect. So make it so that the -gdwarf<unknown> creates an error, just like --gdwarf<unknown> would.
2020-08-28MSP430: Fix alignment of __*_array_start symbols in default linker scriptJozef Lawrynowicz13-1/+320
__{preinit,init,fini}_array_start symbols must be word aligned in linker scripts. If the section preceding the __*_array_start symbol has an odd size, then a NULL byte will be present between the start symbol and the .*_array section itself, when the section gets automatically word-aligned. This results in a branch to an invalid address when the CRT startup code tries to run through the functions listed in the array sections. Some MSP430 linker scripts do not align the __*_array start symbols, so this added warning will catch that problem and help the user avoid the potential incorrect execution of the program. ld/ChangeLog: * emultempl/msp430.em (input_section_exists): New. (check_array_section_alignment): New. (gld${EMULATION_NAME}_finish): New. * scripttempl/elf32msp430.sc: Add ALIGN directives before the definition of __*_array_start symbols. * testsuite/ld-msp430-elf/finiarray-warn.ld: New test. * testsuite/ld-msp430-elf/finiarray-warn.r: New test. * testsuite/ld-msp430-elf/initarray-nowarn.ld: New test. * testsuite/ld-msp430-elf/initarray-warn.ld: New test. * testsuite/ld-msp430-elf/initarray-warn.r: New test. * testsuite/ld-msp430-elf/initarray.s: New test. * testsuite/ld-msp430-elf/msp430-elf.exp: Run new tests. * testsuite/ld-msp430-elf/preinitarray-warn.ld: New test. * testsuite/ld-msp430-elf/preinitarray-warn.r: New test.
2020-08-28LD: Add new %pU vfinfo format for printing linker script nameJozef Lawrynowicz2-3/+10
The %pT vfinfo format prints the linker script name with a line number, however sometimes it may be necessary to print the linker script name without any associated line number. ld/ChangeLog: * ldmisc.c (vfinfo): Support new "%pU" format specifier.
2020-08-28PR26418 UBSAN: cache.c:386 null pointer fwriteAlan Modra2-1/+6
The previous "fix" tested the wrong value. PR 26418 * ecofflink.c (WRITE): Really don't write zero size chunks.
2020-08-28Prevent the linker from overestimating the alignment requirement of common ↵Tuckker2-2/+13
symbols on targets with octets that are larger than one byte. PR 26543 * linker.c (bfd_generic_define_common_symbol): Force the alignment to 1 if the section has now alignment requirement.
2020-08-28[gdb/breakpoint] Handle setting breakpoint on label without addressTom de Vries8-23/+117
Consider test-case test.c: ... $ cat test.c int main (void) { return 0; L1: (void)0; } ... Compiled with debug info: ... $ gcc test.c -g ... When attempting to set a breakpoint at L1, which is a label without address: ... <1><f4>: Abbrev Number: 2 (DW_TAG_subprogram) <f5> DW_AT_name : main <2><115>: Abbrev Number: 3 (DW_TAG_label) <116> DW_AT_name : L1 <119> DW_AT_decl_file : 1 <11a> DW_AT_decl_line : 5 <2><11b>: Abbrev Number: 0 ... we run into an internal-error: ... $ gdb -batch a.out -ex "b main:L1" linespec.c:3233: internal-error: void \ decode_line_full(const event_location*, int, program_space*, symtab*, \ int, linespec_result*, const char*, const char*): \ Assertion `result.size () == 1 || canonical->pre_expanded' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. ... Fix this by detecting the error condition in decode_line_full instead, and throwing an error, such that we have instead: ... (gdb) b main:L1 Location main:L1 not available (gdb) ... Unfortunately, to call event_location_to_string, which is used to get the location name in the error message, we need to pass a non-const struct event_location, because the call may cache the string in the struct (See EL_STRING). So, we change the prototype of decode_line_full accordingly, and everywhere this propages to. Tested on x86_64-linux. gdb/ChangeLog: 2020-08-28 Tom de Vries <tdevries@suse.de> PR breakpoint/26544 * breakpoint.c (parse_breakpoint_sals): Remove const from struct event_location. (create_breakpoint): Same. (base_breakpoint_decode_location): Same. (bkpt_create_sals_from_location): Same. (bkpt_decode_location): Same. (bkpt_probe_create_sals_from_location): Same. (bkpt_probe_decode_location): Same. (tracepoint_create_sals_from_location): Same. (tracepoint_decode_location): Same. (tracepoint_probe_decode_location): Same. (strace_marker_create_sals_from_location): Same. (strace_marker_decode_location): Same. (create_sals_from_location_default): Same. (decode_location_default): Same. * breakpoint.h (struct breakpoint_ops): Same. (create_breakpoint): Same. * linespec.h (decode_line_full): Same. * linespec.c (decode_line_full): Same. Throw error if result.size () == 0. gdb/testsuite/ChangeLog: 2020-08-28 Tom de Vries <tdevries@suse.de> * gdb.base/label-without-address.c: New test. * gdb.base/label-without-address.exp: New file.
2020-08-28CSKY: Support attribute section.Cooper Qu41-101/+827
bfd * elf32-csky.c (csky_archs): Fix arch names. (csky_find_arch_with_name): New. (elf32_csky_merge_attributes): New. (csky_elf_merge_private_bfd_data): Add process of merge attribute section. (elf32_csky_obj_attrs_arg_type): New. (elf32_csky_obj_attrs_handle_unknown): New. (elf_backend_obj_attrs_vendor): Define. (elf_backend_obj_attrs_section): Define. (elf_backend_obj_attrs_arg_type): Define. (elf_backend_obj_attrs_section_type): Define. binutils/ * readelf.c (get_csky_section_type_name): New. (get_section_type_name): Add handler for CSKY. (display_csky_attribute): New. (process_arch_specific): Add handler for CSKY. * testsuite/binutils-all/strip-3.d: Remove .csky.attributes section. elfcpp/ * elfcpp.h (enum SHT): New enum SHT_CSKY_ATTRIBUTES. gas/ * gas/config/tc-csky.c (md_begin): Set attributes. (isa_flag): Change type to unsigned 64 bits. (struct csky_cpu_info): Likewise. (struct csky_macro_info): Likewise. (set_csky_attribute): New. * testsuite/gas/csky/802j.d: Ignore .csky.attributes section. * testsuite/gas/csky/all.d: Likewise. * testsuite/gas/csky/bsr1.d: Likewise. * testsuite/gas/csky/csky_vdsp.d: Likewise. * testsuite/gas/csky/cskyv2_all.d: Likewise. * testsuite/gas/csky/cskyv2_ck803r2.d: Likewise. * testsuite/gas/csky/cskyv2_ck860.d: Likewise. * testsuite/gas/csky/cskyv2_dsp.d: Likewise. * testsuite/gas/csky/cskyv2_elrw.d: Likewise. * testsuite/gas/csky/cskyv2_float.d: Likewise. * testsuite/gas/csky/enhance_dsp.d: Likewise. * testsuite/gas/csky/java.d: Likewise. * testsuite/gas/csky/v1_float.d: Likewise. * testsuite/gas/csky/v2_float_part1.d: Likewise. * testsuite/gas/csky/v2_float_part2.d: Likewise. * testsuite/gas/csky/v2_tls_gd.d: Likewise. * testsuite/gas/csky/v2_tls_ie.d: Likewise. * testsuite/gas/csky/v2_tls_ld.d: Likewise. * testsuite/gas/csky/v2_tls_le.d: Likewise. * testsuite/gas/elf/elf.exp: Add handler for CSKY. * testsuite/gas/elf/section2.e-csky: New. include/ * elf/csky.h (SHT_CSKY_ATTRIBUTES): Define. (Tag_CSKY_ARCH_NAME): New enum constant. (Tag_CSKY_CPU_NAME): Likewise. (Tag_CSKY_ISA_FLAGS): Likewise. (Tag_CSKY_DSP_VERSION): Likewise. (Tag_CSKY_VDSP_VERSION): Likewise. (Tag_CSKY_FPU_VERSION): Likewise. (Tag_CSKY_FPU_ABI): Likewise. (Tag_CSKY_FPU_ROUNDING): Likewise. (Tag_CSKY_FPU_DENORMAL): Likewise. (Tag_CSKY_FPU_Exception): Likewise. (Tag_CSKY_FPU_NUMBER_MODULE): Likewise. (Tag_CSKY_FPU_HARDFP): Likewise. (Tag_CSKY_MAX): Likewise. (VAL_CSKY_DSP_VERSION_EXTENSION): Likewise. (VAL_CSKY_DSP_VERSION_2): Likewise. (VAL_CSKY_VDSP_VERSION_1): Likewise. (VAL_CSKY_VDSP_VERSION_2): Likewise. (VAL_CSKY_FPU_ABI_SOFT): Likewise. (VAL_CSKY_FPU_ABI_SOFTFP): Likewise. (VAL_CSKY_FPU_ABI_HARD): Likewise. (VAL_CSKY_FPU_HARDFP_HALF): Likewise. (VAL_CSKY_FPU_HARDFP_SINGLE): Likewise. (VAL_CSKY_FPU_HARDFP_DOUBLE): Likewise. * opcode/csky.h (CSKY_ISA_VDSP_V2): Define. CSKYV1_ISA_E1: Change to long constant type. CSKYV2_ISA_E1: Likewise. CSKYV2_ISA_1E2: Likewise. CSKYV2_ISA_2E3: Likewise. CSKYV2_ISA_3E7: Likewise. CSKYV2_ISA_7E10: Likewise. CSKYV2_ISA_3E3R1: Likewise. CSKYV2_ISA_3E3R2: Likewise. CSKYV2_ISA_10E60: Likewise. CSKY_ISA_TRUST: Likewise. CSKY_ISA_CACHE: Likewise. CSKY_ISA_NVIC: Likewise. CSKY_ISA_CP: Likewise. CSKY_ISA_MP: Likewise. CSKY_ISA_MP_1E2: Likewise. CSKY_ISA_JAVA: Likewise. CSKY_ISA_MAC: Likewise. CSKY_ISA_MAC_DSP: Likewise. CSKY_ISA_DSP: Likewise. CSKY_ISA_DSP_1E2: Likewise. CSKY_ISA_DSP_ENHANCE: Likewise. CSKY_ISA_FLOAT_E1: Likewise. CSKY_ISA_FLOAT_1E2: Likewise. CSKY_ISA_FLOAT_1E3: Likewise. CSKY_ISA_FLOAT_3E4: Likewise. CSKY_ISA_VDSP: Likewise. ld/ * emulparams/cskyelf.sh: Support attribute section. * testsuite/ld-csky/tls-le-v1.d: Match .csky.attributes section. * ld/testsuite/ld-csky/tls-le.d: Likewise. * testsuite/ld-elf/non-contiguous.ld: Ignore .csky.attributes section. opcodes/ * csky-dis.c (CSKY_DEFAULT_ISA): Define. (csky_dis_info): Add member isa. (csky_find_inst_info): Skip instructions that do not belong to current CPU. (csky_get_disassembler): Get infomation from attribute section. (print_insn_csky): Set defualt ISA flag. * csky.h (CSKY_ISA_VDSP_2): Rename from CSKY_ISA_VDSP_V2. * csky-opc.h (struct csky_opcode): Change isa_flag16 and isa_flag32'type to unsigned 64 bits.
2020-08-28Fixes for testsuite failures introduced by the changes made for PR 19011.Nick Clifton4-4/+23
PR19011 bfd * cofflink.c (_bfd_coff_generic_relocate_section): Provide a value for undefined symbols which will not generate extra warning messages about truncated relocs. ld * testsuite/lib/ld-lib.exp (ld_link_defsyms): For PE based targets define the __main and ___main symbols in terms of the main symbol.
2020-08-28mingw plugin test regressions due to commit 514b4e191d5fAlan Modra2-4/+17
Fixes new failures due to image base change. PR 19011 * testsuite/ld-plugin/plugin.exp: Use modified CFLAGS throughout file. Add --image-base for pecoff.
2020-08-28RISC-V: Treat R_RISCV_CALL and R_RISCV_CALL_PLT as the same in check_relocs.Nelson Chu6-12/+27
In fact, we can treate these two relocation as the same one in the riscv_elf_check_relocs. I have heard that RISC-V lld had made this improvement, and so had GNU AARCH64, they only need R_AARCH64_CALL26 for calls rather than two seperate relocations. Beside, the following PLT issue for RISC-V 32-bit glibc seems to be fixed by applying at least this patch. <https://sourceware.org/pipermail/libc-alpha/2020-August/117214.html> I have ran the toolchain regression, and everything seems fine for now. bfd/ * elfnn-riscv.c (riscv_elf_check_relocs): Treat R_RISCV_CALL and R_RISCV_CALL_PLT as the same in the riscv_elf_check_relocs. (riscv_elf_relocate_section): Remove the R_RISCV_CALL for the unresolved reloc checks. ld/ testsuite/ld-riscv-elf/lib-nopic-01a.s: Use R_RISCV_JAL rather than R_RISCV_CALL. testsuite/ld-riscv-elf/lib-nopic-01b.d: Likewise. testsuite/ld-riscv-elf/lib-nopic-01b.s: Likewise.
2020-08-28Automatic date update in version.inGDB Administrator1-1/+1
2020-08-27Fix advance/until and multiple locations (PR gdb/26524)Pedro Alves5-41/+261
If you do "advance LINESPEC", and LINESPEC expands to more than one location, GDB just errors out: if (sals.size () != 1) error (_("Couldn't get information on specified line.")); For example, advancing to a line in an inlined function, inlined three times: (gdb) b 21 Breakpoint 1 at 0x55555555516f: advance.cc:21. (3 locations) (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y <MULTIPLE> 1.1 y 0x000055555555516f in inline_func at advance.cc:21 1.2 y 0x000055555555517e in inline_func at advance.cc:21 1.3 y 0x000055555555518d in inline_func at advance.cc:21 (gdb) advance 21 Couldn't get information on specified line. (gdb) Similar issue with the "until" command, as it shares the implementation with "advance". Since, as the comment in gdb.base/advance.exp says, "advance <location>" is really just syntactic sugar for "tbreak <location>;continue", fix this by making GDB insert a breakpoint at all the resolved locations. A new testcase is included, which exercises both "advance" and "until", in two different cases expanding to multiple locations: - inlined functions - C++ overloads This also exercises the inline frames issue fixed by the previous patch. gdb/ChangeLog: PR gdb/26524 * breakpoint.c (until_break_fsm) <location_breakpoint, caller_breakpoint>: Delete fields. <breakpoints>: New field. <until_break_fsm>: Adjust to save a breakpoint vector instead of two individual breakpoints. (until_break_fsm::should_stop): Loop over breakpoints in the breakpoint vector. (until_break_fsm::clean_up): Adjust to clear the breakpoints vector. (until_break_command): Handle location expanding into multiple sals. gdb/testsuite/ChangeLog: PR gdb/26523 PR gdb/26524 * gdb.base/advance-until-multiple-locations.cc: New. * gdb.base/advance-until-multiple-locations.exp: New.
2020-08-27Fix advance/until and inline frames (PR gdb/26523)Pedro Alves2-2/+11
If you do "tbreak LINENO; c" to advance to an inlined function, GDB presents the stop at the inline frame instead of at the non-artificial stack frame: (gdb) list 21 18 static inline __attribute__ ((always_inline)) int 19 inline_func (int i) 20 { 21 return i + 1; 22 } (gdb) tbreak 21 Temporary breakpoint 3 at 0x55555555516f: advance.cc:21. (gdb) c Continuing. Temporary breakpoint 3, inline_func (i=0) at advance.cc:21 21 return i + 1; The logic for this is in stopped_by_user_bp_inline_frame: /* Loop over the stop chain and determine if execution stopped in an inlined frame because of a breakpoint with a user-specified location set at FRAME_BLOCK. */ static bool stopped_by_user_bp_inline_frame (const block *frame_block, bpstat stop_chain) If however, you do "advance LINENO" or "until LINENO" instead, GDB presents the stop at the non-artificial frame: (gdb) advance 21 main () at advance.cc:43 43 i = inline_func (i); (gdb) "advance" and "until" should really behave like user breakpoints here, since their location is also user-specified. As the comment in gdb.base/advance.exp says, "advance <location>" is really just syntactic sugar for "tbreak <location>; continue". Fix this by making stopped_by_user_bp_inline_frame also consider advance/until breakpoints. A testcase covering this will be included in the next patch. gdb/ChangeLog: PR gdb/26523 * inline-frame.c (stopped_by_user_bp_inline_frame): Also consider bp_until breakpoints user-specified locations. Update intro comment.
2020-08-27readelf: MSP430: Fix incorrect usage of "msp430x" in function namesJozef Lawrynowicz2-4/+13
The "X" in "MSP430X" indicates an extension to the original MSP430 ISA, but these functions are generically used for all MSP430 ISAs, so the names should not use the "X" suffix. binutils/ChangeLog: * readelf.c (get_msp430x_section_type_name): Rename to ... (get_msp430_section_type_name): ... this. (get_section_type_name): Use get_msp430_section_type_name. (display_msp430x_attribute): Rename to ... (display_msp430_attribute): ... this. (process_arch_specific): Use display_msp430_attribute.
2020-08-27ld/emultempl/msp430.em: Remove unused variableJozef Lawrynowicz2-3/+5
ld/ChangeLog: * emultempl/msp430.em: Remove unused variable "buf".