aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-07-26Fix return type typo in obsd-nat.c that breaks build on OpenBSDBrian Callahan2-1/+7
To recap the bug report: Commit a068643 introduced a small typo that breaks the gdb build on OpenBSD. Line 38 of obsd-nat.c needs to be changed from std::sring to std::string. gdb/ChangeLog 2019-07-26 Brian Callahan <bcallah@openbsd.org> PR gdb/24839: * gdb/obsd-nat.c (obsd_nat_target::pid_to_str): Fix typo in return type.
2019-07-26[gdb/testsuite] Fix unterminated string in i386-pkru.expTom de Vries2-1/+5
I ran into this error: ... ERROR: tcl error sourcing gdb/testsuite/gdb.arch/i386-pkru.exp. ERROR: missing " while executing "untested "" invoked from within "if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ [list debug additional_flags=${comp_flags}]] } { untested "failed to c..." (file "gdb/testsuite/gdb.arch/i386-pkru.exp" line 25) invoked from within ... caused by: ... untested "failed to compile x86 PKEYS test. ... Fix the unterminated string. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-07-26 Tom de Vries <tdevries@suse.de> * gdb.arch/i386-pkru.exp: Fix unterminated string.
2019-07-26PR24798, buffer overflow in process_cu_tu_indexAlan Modra2-29/+32
PR 24798 * dwarf.c (process_cu_tu_index): Avoid integer overflow on 64-bit systems by casting ncols and nslots expressions to size_t. Display number of columns and slots before giving up due to buffer overflow. Use %u to display unsigned ints. Perform more pointer wrap tests.
2019-07-26Begone elf_linkerAlan Modra3-7/+6
This field effectively became usused a long time ago, perhaps as early as 1994. * elf-bfd.h (struct output_elf_obj_tdata): Delete "linker" field. (elf_linker): Don't define. * elflink.c (bfd_elf_final_link): Don't set elf_linker.
2019-07-26Ajdust lto-3r and lto-5r tests for powerpc64Alan Modra3-2/+7
* testsuite/ld-plugin/lto-3r.d: Accept D for powerpc64 descriptors. * testsuite/ld-plugin/lto-5r.d: Likewise.
2019-07-26Automatic date update in version.inGDB Administrator1-1/+1
2019-07-25Fix comment about the signature of add_separate_debug_fileChristian Biesinger2-2/+8
Also fixes the date in the changelog of my last commit. gdb/ChangeLog: 2019-07-25 Christian Biesinger <cbiesinger@google.com> * python/py-objfile.c (add_separate_debug_file): Fix comment about this function's Python signature.
2019-07-25[gdb/testsuite] Test skip_libstdcxx_probe_tests in mi-catch-cpp-exceptions.expTom de Vries4-44/+88
On a system without SDT probes in libstdc++, we run into: ... FAIL: gdb.mi/mi-catch-cpp-exceptions.exp: all with invalid regexp: run until \ breakpoint in main (unknown output after running) ... The test-case uses a regexp argument for the catch throw/rethrow/catch command, which is only supported on systems with SDT probes in libstdc++. Fix this by marking the portions of the test-case that use a regexp argument as unsupported on a system without SDT probes. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-07-25 Tom de Vries <tdevries@suse.de> PR testsuite/24830 * gdb.mi/mi-catch-cpp-exceptions.exp: Call mi_skip_libstdcxx_probe_tests, and skip unsupported tests. * lib/gdb.exp (skip_libstdcxx_probe_tests_prompt): Factor out of ... (skip_libstdcxx_probe_tests): ... here. * lib/mi-support.exp (mi_skip_libstdcxx_probe_tests): New proc.
2019-07-25Fix attributation of DWARF augmentation patch.Nick Clifton1-1/+1
2019-07-25Have readelf and objdump display the contents of the DWARF augmentation data ↵Tom de Vries2-1/+27
as a string, if it is printable. PR 24809 * dwarf.c (display_debug_names): Display the contents of the augmentation string, if it is printable.
2019-07-25When linking binary files into MIPS executables, default to MIPS 3 ↵YunQiang Su2-0/+12
emaulation for 64-bit objects. PR 24832 * elfxx-mips.c (mips_set_isa_flags): Default to MIPS 3 for 64-bit mips inputs.
2019-07-25Stop an illegal memory access by readelf when parsing a corrupt MIPS binary ↵Nick Clifton2-4/+41
file. PR 24837 * readelf.c (process_mips_specific): Check for buffer overflow before reading reginfo information.
2019-07-24Allow passing a block to lookup_global_symbol_from_objfileChristian Biesinger6-5/+23
This has no behavior change in itself, but allows a future patch to add a function to the Python API to look up symbols in the static block. gdb/ChangeLog: 2019-07-24 Christian Biesinger <cbiesinger@google.com> * compile/compile-object-load.c (compile_object_load): Pass GLOBAL_SCOPE. * solib-spu.c (spu_lookup_lib_symbol): Pass GLOBAL_SCOPE. * solib-svr4.c (elf_lookup_lib_symbol): Pass GLOBAL_SCOPE. * symtab.c (lookup_global_symbol_from_objfile): Add a scope parameter. * symtab.h (lookup_global_symbol_from_objfile): Likewise.
2019-07-25Automatic date update in version.inGDB Administrator1-1/+1
2019-07-24[gdb/testsuite] Fix implicit declaration of printf in gdb.objc/*.mTom de Vries4-0/+10
When running gdb.objc/objcdecode.exp we get: ... objcdecode.m: In function '-[Decode multipleDef]': objcdecode.m:14:3: warning: incompatible implicit declaration of built-in \ function 'printf' printf("method multipleDef\n"); ^~~~~~ objcdecode.m:14:3: note: include '<stdio.h>' or provide a declaration of \ 'printf' ... Fix this in the three gdb.objc/*.m test-cases by including stdio.h. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-07-24 Tom de Vries <tdevries@suse.de> PR testsuite/24807 * gdb.objc/basicclass.m: Include stdio.h. * gdb.objc/nondebug.m: Same. * gdb.objc/objcdecode.m: Same.
2019-07-24Revert "Remove tests that test __gnu_lto_v1 symbol."H.J. Lu4-0/+27
Revert commit 8c728a9d93e2342c57039fcdd6e4a502875b9e09 Author: Martin Liska <mliska@suse.cz> Date: Mon Jul 22 14:23:32 2019 +0200 Remove tests that test __gnu_lto_v1 symbol. since outputs of these tests are used by later tests. Check the normal symbol, foo, instead of __gnu_lto_v.*, which GCC stopped emitting after r273662. * testsuite/ld-plugin/lto-3r.d: Restored. Check foo instead of __gnu_lto_v.*. * testsuite/ld-plugin/lto-5r.d: Likewise. * testsuite/ld-plugin/lto.exp: Run lto-3r and lto-5r tests.
2019-07-24[gdb/testsuite] Fix infoline-reloc-main-from-zero.exp compilationTom de Vries2-1/+7
When running gdb.base/infoline-reloc-main-from-zero.exp, I see: ... Running gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp ... gdb compile failed, ld: infoline-reloc-main-from-zero: \ not enough room for program headers, try linking with -N ld: final link failed: bad value collect2: error: ld returned 1 exit status UNTESTED: gdb.base/infoline-reloc-main-from-zero.exp: infoline-reloc-main-from-zero.exp UNTESTED: gdb.base/infoline-reloc-main-from-zero.exp: failed to compile ... Fix this by following the suggestion: ... -set opts {debug "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00"} +set opts {debug "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00 -Wl,-N"} ... Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-07-24 Tom de Vries <tdevries@suse.de> PR testsuite/24612 * gdb.base/infoline-reloc-main-from-zero.exp: Add -Wl,-N to additional_flags.
2019-07-24[ARC] [COMMITTED] Fix formatting.Claudiu Zissulescu2-68/+82
Small formatting fixes. 2019-07-24 Claudiu Zissulescu <claziss@synopsys.com> * elf32-arc.c (bfd_get_32_me): Add a small description, fix formatting. (reloc_type_to_name): Fix formatting. (arc_elf_object_p): Likewise. (debug_arc_reloc): Likewise. (arc_do_relocation): Likewise.
2019-07-24Update the Swedish translation for the gas sub-directory.Nick Clifton2-4191/+5083
2019-07-24[ARC] Update disassembler opcode selectionClaudiu Zissulescu4-2/+35
New instruction are added, and some of them are overlapping. Update disassembler to correctly recognize them. Introduce nps400 option. opcodes/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * arc-dis.c (skip_this_opcode): Check also for 0x07 major opcodes, and MPY class instructions. (parse_option): Add nps400 option. (print_arc_disassembler_options): Add nps400 info. gas/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gas/arc/nps400-6.d: Update test.
2019-07-24[ARC] Update ARC opcode tableClaudiu Zissulescu6-1461/+2263
Update ARC opcode table by cleaning up invalid instructions, and fixing wrong encodings. opcodes/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * arc-ext-tbl.h (bspeek): Remove it, added to main table. (bspop): Likewise. (modapp): Likewise. * arc-opc.c (RAD_CHK): Add. * arc-tbl.h: Regenerate. include/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * include/opcode/arc.h (FASTMATH): Add. (SWITCH): Likewise.
2019-07-24[ARC] Add linker relaxation.Claudiu Zissulescu5-0/+218
Add linker relaxation. The first relaxation added is converting GOTPC32 to PCREL relocations. This relaxation doesn't change the size of the binary. bfd/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * elf32-arc.c (bfd_get_32_me): New function. (bfd_put_32_me): Likewise. (arc_elf_relax_section): Likewise. (bfd_elf32_bfd_relax_section): Define. ld/testsuite/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * ld-arc/relax-local-pic.d: New test. * ld-arc/relax-local-pic.s: New file.
2019-07-24gdb/h8300-tdep.c: Fix register name in h8300h machine.Yoshinori Sato2-22/+42
H8/300H general register name "ER0" - "ER7". But gdb using "R0" - "R7". This changes register name "ER0" - "ER7" in h8300h machine mode. gdb/ChangeLog: * h8300-tdep.c (h8300_register_name_common): New. h8300_register_name): Use h8300_register_name_common. (h8300s_register_name): Likewise. (h8300sx_register_name): Likewise. (h8300h_register_nam): New. (h8300_gdbarch_init): Use h8300h_register_name in h8300h machine.
2019-07-24Fix ar so that it can correctly detect non-dash prefixed options that appear ↵Nick Clifton2-1/+19
after dash prefixed options. PR 13256 * ar.c (decode_options): Restart option scanning if no operation is detected and argument remain to be scanned.
2019-07-24Complain about mbind, ifunc, and unique in final_writeAlan Modra37-127/+198
It's not as good as complaining in gas/config/obj-elf.c since you lose any reference to the source file. bfd/ * elf-bfd.h (struct elf_backend_data): Return bfd_boolean from elf_backend_final_write_processing, don't pass linker arg. (_bfd_elf_final_write_processing): Update prototype. * elf.c (_bfd_elf_write_object_contents): Adjust call. (_bfd_elf_final_write_processing): Return error on incompatible OSABI and has_gnu_osabi. Remove linker arg. * elf-nacl.h (nacl_final_write_processing): Update prototype. * elf-vxworks.h (elf_vxworks_final_write_processing): Likewise. * elfxx-mips.h (_bfd_mips_final_write_processing): Likewise. (_bfd_mips_elf_final_write_processing): Likewise. * elf-hppa.h (elf_hppa_final_write_processing): Return status and remove linker arg. * elf-m10300.c (_bfd_mn10300_elf_final_write_processing): Likewise. * elf-nacl.c (nacl_final_write_processing): Likewise. * elf-vxworks.c (elf_vxworks_final_write_processing): Likewise. * elf32-arc.c (arc_elf_final_write_processing): Likewise. * elf32-arm.c (arm_final_write_processing): Likewise. (elf32_arm_final_write_processing): Likewise. (elf32_arm_nacl_final_write_processing): Likewise. (elf32_arm_vxworks_final_write_processing): Likewise. * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise. * elf32-bfin.c (elf32_bfin_final_write_processing): Likewise. * elf32-cr16.c (_bfd_cr16_elf_final_write_processing): Likewise. * elf32-cris.c (cris_elf_final_write_processing): Likewise. * elf32-h8300.c (elf32_h8_final_write_processing): Likewise. * elf32-lm32.c (lm32_elf_final_write_processing): Likewise. * elf32-m32r.c (m32r_elf_final_write_processing): Likewise. * elf32-m68k.c (elf_m68k_final_write_processing): Likewise. * elf32-mips.c (mips_vxworks_final_write_processing): Likewise. * elf32-msp430.c (bfd_elf_msp430_final_write_processing): Likewise. * elf32-nds32.c (nds32_elf_final_write_processing): Likewise. * elf32-or1k.c (or1k_elf_final_write_processing): Likewise. * elf32-pj.c (pj_elf_final_write_processing): Likewise. * elf32-ppc.c (ppc_final_write_processing): Likewise. (ppc_elf_final_write_processing): Likewise. (ppc_elf_vxworks_final_write_processing): Likewise. * elf32-sparc.c (sparc_final_write_processing): Likewise. (elf32_sparc_final_write_processing): Likewise. (elf32_sparc_vxworks_final_write_processing): Likewise. * elf32-v850.c (v850_elf_final_write_processing): Likewise. * elf32-xc16x.c (elf32_xc16x_final_write_processing): Likewise. * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise. * elf64-ia64-vms.c (elf64_vms_final_write_processing): Likewise. * elfnn-ia64.c (elfNN_ia64_final_write_processing): Likewise. * elfxx-mips.c (_bfd_mips_final_write_processing): Likewise. (_bfd_mips_elf_final_write_processing): Likewise. gas/ * config/obj-elf.c (obj_elf_section, obj_elf_type): Set has_gnu_osabi. * testsuite/gas/elf/section12a.d: Update xfails. * testsuite/gas/elf/section12b.d: Likewise.
2019-07-24Re: ELF final_write_processingAlan Modra4-20/+20
I missed some early exits from final_write_processing that mean _bfd_elf_final_write_processing could be missed. * elf-vxworks.c (elf_vxworks_final_write_processing): Don't return early. * elf32-arc.c (arc_elf_final_write_processing): Likewise. * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise.
2019-07-24Define ELF_OSABI for visiumAlan Modra6-6/+23
and update expected results for gas mbind tests. bfd/ * elf32-visium.c (visium_elf_post_process_headers): Don't set EI_OSABI header byte here. (ELF_OSABI): Define. gas/ * testsuite/gas/elf/section12a.d: xfail visium and cloudabi. * testsuite/gas/elf/section12b.d: Likewise. * testsuite/gas/elf/section13.d: Likewise.
2019-07-24PT_GNU_MBIND section mappingAlan Modra2-1/+8
* elf/internal.h (ELF_SECTION_IN_SEGMENT_1): Exclude non-alloc sections in GNU_MBIND segments.
2019-07-24Update expected info threads error messages in gdb.multi/tids.expTom de Vries2-7/+19
We currently have these FAILs: ... FAIL: gdb.multi/tids.exp: two inferiors: info threads -1 FAIL: gdb.multi/tids.exp: two inferiors: info threads -$one ... because we're expecting: ... Invalid thread ID: -1 ... but instead we have: ... Unrecognized option at: -1 ... This error message for info threads has changed since commit 54d6600669 'Make "info threads" use the gdb::option framework'. Update the test accordingly. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-07-24 Tom de Vries <tdevries@suse.de> PR testsuite/24831 * gdb.multi/tids.exp: Update error messages for info threads.
2019-07-24[gdb/testsuite] Fix info-types.exp for debug info from more than one fileTom de Vries2-2/+11
On openSUSE Leap 15.0, I get: ... FAIL: gdb.base/info-types.exp: l=c: info types FAIL: gdb.base/info-types.exp: l=c++: info types ... because the info type command prints info for files info-types.c, stddef.h, elf-init.c and init.c, while the regexp in the test-case expect only info for info-types.c. Fix this by extending the regexp. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-07-24 Tom de Vries <tdevries@suse.de> * gdb.base/info-types.exp: Allow info types to print info for more than one file.
2019-07-24Automatic date update in version.inGDB Administrator1-1/+1
2019-07-23Fix objdump's display of indirect strings in object files, which was broken ↵Nick Clifton3-6/+10
by the link following code. PR 24818 * objdump.c (is_relocateable): Delete. (load_specific_debug_section): Test the abfd for relocations directly, rather than relying upon is_relocateable. (dump_dwarf): Delete initlialization of is_relocateable.
2019-07-23Add missing ChangeLog entries forH.J. Lu1-0/+7
commit 8c728a9d93e2342c57039fcdd6e4a502875b9e09 Author: Martin Liska <mliska@suse.cz> Date: Mon Jul 22 14:23:32 2019 +0200 Remove tests that test __gnu_lto_v1 symbol.
2019-07-23[AArch64] Add support for GMID_EL1 register for +memtagKyrylo Tkachov6-1/+17
We're missing support for the GMID_EL1 system register from the Memory Tagging Extension in binutils. This is specified at: https://developer.arm.com/docs/ddi0595/latest/aarch64-system-registers/gmid_el1 This simple patch adds the support for this read-only register. Tested make check on gas.
2019-07-23[gdb/testsuite] Add missing initial prompt read in multidictionary.expTom de Vries2-0/+12
When running multidictionary.exp in conjunction with: ... $ stress -c $(($(cat /proc/cpuinfo | grep -c "^processor") + 1)) ... we get: ... Running gdb/testsuite/gdb.dwarf2/multidictionary.exp ... ERROR: Couldn't load multidictionary into gdb. === gdb Summary === nr of unresolved testcases 1 ... The multidictionary test-case needs -readnow, and achieves this using: ... gdb_spawn_with_cmdline_opts "-readnow" gdb_load ... but the initial gdb prompt is not read. Usually, the following gdb_load command accidentally consumes that initial prompt (at the gdb_expect for the kill command in gdb_file_cmd). But under high load, that doesn't happen and we run into the error. Fix this by consuming the initial gdb prompt after spawning gdb. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-07-23 Tom de Vries <tdevries@suse.de> PR testsuite/24842 * gdb.dwarf2/multidictionary.exp: Consume initial prompt after gdb_spawn_with_cmdline_opts.
2019-07-23[gdb][Arm]: gdb cannot step across CMSE secure entry function code.Srinath Parvathaneni5-0/+167
GDB is not able to execute "step" command on function calls of Armv8-M cmse secure entry functions. Everytime GNU linker come across definition of any cmse secure entry function in object file(s), it creates two new instructions secure gateway (sg) and original branch destination (b.w), place those two instructions in ".gnu.sgstubs" section of executable. Any function calls to these cmse secure entry functions is re-directed through secure gateway (sg) present in ".gnu.sgstubs" section. Example: Following is a function call to cmse secure entry function "foo": ... bl xxxx <foo> --->(a) ... <foo> xxxx: push {r7, lr} GNU linker on finding out "foo" is a cmse secure entry function, created sg and b.w instructions and place them in ".gnu.sgstubs" section (marked by c). The "bl" instruction (marked by a) which is a call to cmse secure entry function is modified by GNU linker (as marked by b) and call flow is re-directly through secure gateway (sg) in ".gnu.sgstubs" section. ... bl yyyy <foo> ---> (b) ... section .gnu.sgstubs: ---> (c) yyyy <foo> yyyy: sg // secure gateway b.w xxxx <__acle_se_foo> // original_branch_dest ... 0000xxxx <__acle_se_foo> xxxx: push {r7, lr} ---> (d) On invoking GDB, when the control is at "b" and we pass "step" command, the pc returns "yyyy" (sg address) which is a trampoline and which does not exist in source code. So GDB jumps to next line without jumping to "__acle_se_foo" (marked by d). The above details are published on the Arm website [1], please refer to section 5.4 (Entry functions) and section 3.4.4 (C level development flow of secure code). [1] https://developer.arm.com/architectures/cpu-architecture/m-profile/docs/ecm0359818/latest/armv8-m-security-extensions-requirements-on-development-tools-engineering-specification This patch fixes above problem by returning target pc "xxxx" to GDB on executing "step" command at "b", so that the control jumps to "__acle_se_foo" (marked by d). gdb/ChangeLog: * arm-tdep.c (arm_skip_cmse_entry): New function. (arm_is_sgstubs_section): New function. (arm_skip_stub): Add call to arm_skip_cmse_entry function. gdb/testsuite/ChangeLog: * gdb.arch/arm-cmse-sgstubs.c: New test. * gdb.arch/arm-cmse-sgstubs.exp: New file.
2019-07-23Remove tests that test __gnu_lto_v1 symbol.Martin Liska3-20/+0
ld/ChangeLog: 2019-07-22 Martin Liska <mliska@suse.cz> * testsuite/ld-plugin/lto-3r.d: Remove. * testsuite/ld-plugin/lto-5r.d: Remove. * testsuite/ld-plugin/lto.exp: Do not run lto-3r and lto-5r tests.
2019-07-23SHF_GNU_MBIND requires ELFOSABI_GNUAlan Modra14-108/+205
When SHF_GNU_MBIND was added in the SHF_LOOS to SHF_HIOS range, it should have required ELFOSABI_GNU since these flags are already in use by other OSes. HPUX SHF_HP_TLS in fact has the same value. That means no place in binutils should test SHF_GNU_MBIND without first checking OSABI, and SHF_GNU_MBIND should not be set without also setting OSABI. At least, that's the ideal, but the patch accepts SHF_GNU_MBIND on ELFOSABI_NONE object files since gas didn't always set OSABI. However, to reinforce the fact that SHF_GNU_MBIND isn't proper without a non-zero OSABI, readelf will display the flag as LOOS+0 if OSABI isn't set. The clash with SHF_HP_TLS means that hppa64-linux either has that flag on .tbss sections or supports GNU_MBIND, not both. (hppa64-linux users, if there are any, may have noticed that GNU ld since 2017 mysteriously aligned their .tbss sections to a 4k boundary. That was one consequence of SHF_HP_TLS being blindly interpreted as SHF_GNU_MBIND.) Since it seems that binutils, gdb, gcc, glibc, and the linux kernel don't care about SHF_HP_TLS I took that flag out of .tbss for hppa64-linux. bfd/ * elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_mbind. * elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_mbind. (get_program_header_size): Formatting. Only test SH_GNU_MBIND when elf_gnu_osabi_mbind is set. (_bfd_elf_map_sections_to_segments): Likewise. (_bfd_elf_init_private_section_data): Likewise. (_bfd_elf_final_write_processing): Update comment. * elf64-hppa.c (elf64_hppa_special_sections): Move .tbss entry. (elf_backend_special_sections): Define without .tbss for linux. binutils/ * readelf.c (get_parisc_segment_type): Split off hpux entries.. (get_ia64_segment_type): ..and these.. (get_hpux_segment_type): ..to here. (get_segment_type): Condition GNU_MBIND on osabi. Use get_hpux_segment_type. (get_symbol_binding): Do not print UNIQUE for ELFOSABI_NONE. (get_symbol_type): Do not print IFUNC for ELFOSABI_NONE. gas/ * config/obj-elf.c (obj_elf_change_section): Don't emit a fatal error for non-SHF_ALLOC SHF_GNU_MBIND here. (obj_elf_parse_section_letters): Return SHF_GNU_MBIND in new gnu_attr param. (obj_elf_section): Adjust obj_elf_parse_section_letters call. Formatting. Set SHF_GNU_MBIND and elf_osabi from gnu_attr. Emit normal error for non-SHF_ALLOC SHF_GNU_MBIND and wrong osabi. (obj_elf_type): Set elf_osabi for ifunc. * testsuite/gas/elf/section12a.d: xfail msp430 and hpux. * testsuite/gas/elf/section12b.d: Likewise. * testsuite/gas/elf/section13.d: Likewise. * testsuite/gas/elf/section13.l: Adjust expected error. ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Condition SHF_GNU_MBIND on osabi. Set output elf_gnu_osabi_mbind.
2019-07-23ELF final_write_processingAlan Modra40-99/+175
Move setting of OSABI to final_write_processing, after symbols are written. This allows OSABI to be set based on symbols actually written to the output rather than assuming input symbols will be output. Corrects object files such as the one generated on powerpc64le-linux by ld-powerpc/pr23927.s which has a local STT_GNU_IFUNC symbol but prior to this patch the file was marked ELFOSABI_NONE. * elf-bfd.h (enum elf_gnu_osabi): Rename from elf_gnu_symbols. Remove none, any, all enums. (struct elf_obj_tdata): Rename has_gnu_symbols field to has_gnu_osabi. (_bfd_elf_final_write_processing): Declare. * elf.c (_bfd_elf_write_object_contents): Unconditionally call elf_backend_final_write_processing. (_bfd_elf_post_process_headers): Move body of function to.. (_bfd_elf_final_write_processing): ..here, but set EI_OSABI byte only when not already set. Adjust for rename. * elfxx-target.h (elf_backend_final_write_processing): Default to _bfd_elf_final_write_processing. * elf-hppa.h (elf_hppa_final_write_processing): Call _bfd_elf_final_write_processing. * elf-m10300.c (_bfd_mn10300_elf_final_write_processing): Likewise. * elf-nacl.c (nacl_final_write_processing): Likewise. * elf-vxworks.c (elf_vxworks_final_write_processing): Likewise. * elf32-arc.c (arc_elf_final_write_processing): Likewise. * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise. * elf32-bfin.c (elf32_bfin_final_write_processing): Likewise. * elf32-cr16.c (_bfd_cr16_elf_final_write_processing): Likewise. * elf32-cris.c (cris_elf_final_write_processing): Likewise. * elf32-h8300.c (elf32_h8_final_write_processing): Likewise. * elf32-lm32.c (lm32_elf_final_write_processing): Likewise. * elf32-m32r.c (m32r_elf_final_write_processing): Likewise. * elf32-m68k.c (elf_m68k_final_write_processing): Likewise. * elf32-msp430.c (bfd_elf_msp430_final_write_processing): Likewise. * elf32-nds32.c (nds32_elf_final_write_processing): Likewise. * elf32-or1k.c (or1k_elf_final_write_processing): Likewise. * elf32-pj.c (pj_elf_final_write_processing): Likewise. * elf32-v850.c (v850_elf_final_write_processing): Likewise. * elf32-xc16x.c (elf32_xc16x_final_write_processing): Likewise. * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise. * elf64-ia64-vms.c (elf64_vms_final_write_processing): Likewise. * elfnn-ia64.c (elfNN_ia64_final_write_processing): Likewise. * elf32-arm.c (arm_final_write_processing): Split out from.. (elf32_arm_final_write_processing): ..here. Call _bfd_elf_final_write_processing. (elf32_arm_nacl_final_write_processing): Adjust. * elfxx-mips.c (_bfd_mips_final_write_processing): Split out from.. (_bfd_mips_elf_final_write_processing): ..here. Call _bfd_elf_final_write_processing. * elfxx-mips.h (_bfd_mips_final_write_processing): Declare. * elf32-mips.c (mips_vxworks_final_write_processing): Adjust. * elf32-ppc.c (ppc_final_write_processing): Split out from.. (ppc_elf_final_write_processing): ..here. Call _bfd_elf_final_write_processing. (ppc_elf_vxworks_final_write_processing): Adjust. * elf32-sparc.c (sparc_final_write_processing): Split out from.. (elf32_sparc_final_write_processing): ..here. Call _bfd_elf_final_write_processing. (elf32_sparc_vxworks_final_write_processing): Adjust. * elf32-d10v.c (elf_backend_final_write_processing): Don't define. * elf32-d30v.c (elf_backend_final_write_processing): Don't define. * elf32-m68hc11.c (elf_backend_final_write_processing): Don't define. * elf32-m68hc12.c (elf_backend_final_write_processing): Don't define. * elf32-s12z.c (elf_backend_final_write_processing): Don't define. * elf32-i386.c (elf_i386_check_relocs): Don't set has_gnu_symbols. * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. * elflink.c (elf_link_add_object_symbols): Likewise. (elf_link_output_symstrtab): Set has_gnu_osabi for symbols here instead.
2019-07-23Move ld-scripts size testsAlan Modra13-101/+104
Also restore them somewhat closer to the original. They originally failed on many targets, and a month later I "simplified" them as part of a larger patch fixing other failing tests. That unfortunately lost their main purpose, which was to test TLS layout. * testsuite/ld-elf/size-1.d, * testsuite/ld-elf/size-1.s, * testsuite/ld-elf/size-1.t: New test. * testsuite/ld-elf/size-2.d, * testsuite/ld-elf/size-2.s, * testsuite/ld-elf/size-2.t: New test. * testsuite/ld-scripts/size-1.d, * testsuite/ld-scripts/size-1.s, * testsuite/ld-scripts/size-1.t, * testsuite/ld-scripts/size-2.s, * testsuite/ld-scripts/size-2.d, * testsuite/ld-scripts/size-2.t, * testsuite/ld-scripts/size.exp: Delete.
2019-07-23binutils testsuite test for ELF32 vs ELF64Alan Modra2-2/+7
* testsuite/binutils-all/objcopy.exp (elf64): Correct object file used to set this variable.
2019-07-23gas "mbind sections" testAlan Modra2-2/+4
Doesn't fail on rx-elf * testsuite/gas/elf/section12a.d: Don't skip for rx.
2019-07-23Add Changelog entry missing from previous delta.Nick Clifton1-0/+5
2019-07-22 Barnaby Wilks <barnaby.wilks@arm.com> * arm-dis.c (is_mve_unpredictable): Stop marking some MVE instructions as UNPREDICTABLE.
2019-07-23Allow objdump to recognise the System.Runtime.dll files that get shipped ↵Omar Majid11-17/+335
with .NET Core 2.1. include * coff/i386.h (IMAGE_FILE_MACHINE_NATIVE_APPLE_OVERRIDE): Define. (IMAGE_FILE_MACHINE_NATIVE_FREEBSD_OVERRIDE): Define. (IMAGE_FILE_MACHINE_NATIVE_LINUX_OVERRIDE): Define. (IMAGE_FILE_MACHINE_NATIVE_NETBSD_OVERRIDE): Define. (I386_APPLE_MAGIC): Define. (I386_FREEBSD_MAGIC): Define. (I386_LINUX_MAGIC): Define. (I386_NETBSD_MAGIC): Define. (I386BADMAG): Extend macro to allow new magic numbers. * coff/x86_64.h (IMAGE_FILE_MACHINE_NATIVE_APPLE_OVERRIDE): Define. (IMAGE_FILE_MACHINE_NATIVE_FREEBSD_OVERRIDE): Define. (IMAGE_FILE_MACHINE_NATIVE_LINUX_OVERRIDE): Define. (IMAGE_FILE_MACHINE_NATIVE_NETBSD_OVERRIDE): Define. (AMD64_APPLE_MAGIC): Define. (AMD64_FREEBSD_MAGIC): Define. (AMD64_LINUX_MAGIC): Define. (AMD64_NETBSD_MAGIC): Define. (AMD64BADMAG): Extend macro to allow new magic numbers. bfd * coffcode.h (coff_set_arch_mach_hook): Handle I386_APPLE_MAGIC, I386_FREEBSD_MAGIC, I386_LINUX_MAGIC, I386_NETBSD_MAGIC, AMD64_APPLE_MAGIC, AMD64_FREEBSD_MAGIC, AMD64_LINUX_MAGIC, AMD64_NETBSD_MAGIC. * peXXigen.c: Add comment about source of .NET magic numbers. binutils* Makefile.am (AUTOMAKE_OPTIONS): Add subdir-objects (GENTESTDLLSPROG): Define. (TEST_PROGS): Add GENTESTDLLSPROG. * Makefile.in: Regenerate. * testsuite/binutils-all/objdump.exp (test_objdump_dotnet_assemblies): New proc. Run the new proc. * testsuite/gentestdlls.c: New source file.
2019-07-23[gdb/testsuite] Fix command result testing in mi-complete.expTom de Vries2-2/+10
When running gdb.mi/mi-complete.exp in conjunction with: ... $ stress -c $(($(cat /proc/cpuinfo | grep -c "^processor") + 1)) ... we get less than 50% full passes: ... $ for n in $(seq 1 100); do \ make V=1 -O check \ 'RUNTESTFLAGS=gdb.mi/mi-complete.exp --target_board=unix'; \ done 2>&1 \ | grep "expected passes" | sort | uniq -c 45 # of expected passes 7 9 # of expected passes 8 46 # of expected passes 9 ... A diff between a passing and failing gdb.log shows this difference: ... -&"set max-completions 1\n" 2-complete br +&"set max-completions 1\n" ... The problem is that the test-case issues the "set max-completion <n>" command, and without waiting for the output issues a next command, and tries to parse the results of both commands, expecting a specific interleaving of the various output streams. Fix the FAIL by waiting for the result of the "set max-completion <n>" command before issuing another command. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-07-23 Tom de Vries <tdevries@suse.de> PR testsuite/24711 * gdb.mi/mi-complete.exp: Wait for "set max-completions" result before issuing next command.
2019-07-23Automatic date update in version.inGDB Administrator1-1/+1
2019-07-22Remove self-assign from make_invisible_and_set_new_heightTom Tromey2-2/+7
In https://sourceware.org/ml/gdb-patches/2019-07/msg00509.html, Jan pointed out that clang points out that make_invisible_and_set_new_height self-assigns "height". This patch fixes the bug by renaming the formal parameter. gdb/ChangeLog 2019-07-22 Tom Tromey <tom@tromey.com> * tui/tui-win.c (tui_win_info::make_invisible_and_set_new_height): Don't self-assign.
2019-07-22Fixes the linker testcase "Secure gateway veneers:cmse functions debug ↵Srinath Parvathaneni2-9/+14
information missing" which was failing due to output regular expression mismatch on arm-none-linux-gnueabihf targets. * ld/testsuite/ld-arm/cmse_main_sec_debug.d: Modify regexps to allow for output from a arm-none-linux-gnueabihf target.
2019-07-22This patch addresses the change in the June Armv8.1-M Mainline ↵Barnaby Wilks11-141/+136
specification, that marks certain MVE instructions as no longer UNPREDICTABLE when a source operand is the same as a destination operand for a 32-bit element size. The instructions that this change apply to are: VQDMLADH, VQRDMLADH, VQDMLSDH, VQRDMLSDH The updated documentation is here: https://static.docs.arm.com/ddi0553/bh/DDI0553B_h_armv8m_arm.pdf Fixed this by removing the check for this warning from GAS as well as opcodes. Added testcases to test that the warning is not generated for the instructions that have a 32-bit element size and the same source and destination operand. Also fixed tests that would previously check for this warning. gas * config/tc-arm.c (do_mve_vqdmladh): Remove check for UNPREDICTABLE. * testsuite/gas/arm/mve-vqdmladh-bad.l: Remove tests. * testsuite/gas/arm/mve-vqdmladh-bad.s: Remove tests. * testsuite/gas/arm/mve-vqdmladh.d: New tests. * testsuite/gas/arm/mve-vqdmladh.s: New tests. * testsuite/gas/arm/mve-vqdmlsdh-bad.l: Remove tests. * testsuite/gas/arm/mve-vqdmlsdh-bad.s: Remove tests. * testsuite/gas/arm/mve-vqdmlsdh.d: New tests. * testsuite/gas/arm/mve-vqdmlsdh.s: New tests. opcodes * arm-dis.c (is_mve_unpredictable): Stop marking some MVE instructions as UNPREDICTABLE.
2019-07-22gdb: Show type summary for anonymous structures from c_print_typedefAndrew Burgess6-8/+73
Currently each language has a la_print_typedef method, this is only used for the "info types" command. The documentation for "info types" says: Print a brief description of all types whose names match the regular expression @var{regexp} (or all types in your program, if you supply no argument). However, if we consider this C code: typedef struct { int a; } my_type; Then currently with "info types" this will be printed like this: 3: typedef struct { int a; } my_type; I see two problems with this, first the indentation is clearly broken, second, if the struct contained more fields then it feels like the actual type names could easily get lost in the noise. Given that "info types" is about discovering type names, I think there is an argument to be made that we should focus on giving _only_ the briefest summary for "info types", and if the user wants to know more they can take the type name and plug it into "ptype". As such, I propose that a better output would be: 3: typedef struct {...} my_type; The user understands that there is a type called `my_type`, and that it's an alias for an anonymous structure type. The change to achieve this turns out to be pretty simple, but only effects languages that make use of c_print_typedef, which are C, C++, asm, minimal, d, go, objc, and opencl. Other languages will for now do whatever they used to do. The patch to change how anonymous structs are displayed also changes the display of anonymous enums, consider this code sample: typedef enum { AA, BB, CC } anon_enum_t; This used to be displayed like this: 3: typedef enum {AA, BB, CC} anon_enum_t; Which will quickly become cluttered for enums with a large number of values. The modified output looks like this: 3: typedef enum {...} anon_enum_t; Again, the user can always make use of ptype if they want to see the details of the anon_enum_t type. It is worth pointing out that this change (to use {...}) only effects anonymous structs and enums, named types don't change with this patch, consider this code: struct struct_t { int i; }; enum enum_t { AA, BB, CC }; The output from 'info types' remains unchanged, like this: 4: enum enum_t; 1: struct struct_t; An additional area of interest is how C++ handles anonymous types used within a typedef; enums are handled basically inline with how C handles them, but structs (and classes) are slightly different. The behaviour before the patch is different, and is unchanged by this patch. Consider this code compiled for C++: typedef struct { int i; } struct_t; Both before and after this patch, this is show by 'info types' as: 3: typedef struct_t struct_t; Unions are displayed similarly to structs in both C and C++, the handling of anonymous unions changes for C in the same way that it changes for anonymous structs. I did look at ada, as this is the only language to actually have some tests for "info types", however, as I understand it ada doesn't really support typedefs, however, by forcing the language we can see what ada would print. So, if we 'set language ada', then originally we printed this: 3: record a: int; end record Again the indentation is clearly broken, but we also have no mention of the type name at all, which is odd, but understandable given the lack of typedefs. If I make a similar change as I'm proposing for C, then we now get this output: 3: record ... end record Which is even less informative I think. However, the original output _is_ tested for in gdb.ada/info_auto_lang.exp, and its not clear to me if the change is a good one or not, so for now I have left this out. gdb/ChangeLog: * c-typeprint.c (c_print_typedef): Pass -1 instead of 0 to type_print. gdb/testsuite/ChangeLog: * gdb.ada/info_auto_lang.exp: Update expected results. * gdb.base/info-types.c: Add additional types to check. * gdb.base/info-types.exp: Update expected results.