aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-04-07Add new linker option: --warn-orphan which generates warning messages when ↵Nick Clifton10-0/+67
orphan sections are detected. ld * ld.h (struct ld_config_type): Add new field: warn_orphan. * ldlex.h (enum option_values): Add OPTION_WARN_ORPHAN and OPTION_NO_WARN_ORPHAN. * lexsup.c (ld_options): Add --warn-orphan and --no-warn-orphan. (parse_args): Handle the new options. * ldemul.c (ldemul_place_orphan): If requested, generate a warning message when an orphan section is placed in the output file. * ld.texinfo: Document the new option. * NEWS: Mention the new feature. tests * ld-elf/orphan-5.l: New test - checks the linker's output with --warn-orphan enabled. * ld-elf/elf.exp: Run the new test.
2015-04-07update thread list, delete exited threadsPedro Alves6-10/+57
On GNU/Linux, if the running kernel supports clone events, then linux-thread-db.c defers thread listing to the target beneath: static void thread_db_update_thread_list (struct target_ops *ops) { ... if (target_has_execution && !thread_db_use_events ()) ops->beneath->to_update_thread_list (ops->beneath); else thread_db_update_thread_list_td_ta_thr_iter (ops); ... } However, when live debugging, the target beneath, linux-nat.c, does not implement the to_update_thread_list method. The result is that if a thread is marked exited (because it can't be deleted right now, e.g., it was the selected thread), then it won't ever be deleted, until the process exits or is killed/detached. A similar thing happens with the remote.c target. Because its target_update_thread_list implementation skips exited threads when it walks the current thread list looking for threads that no longer exits on the target side, using ALL_NON_EXITED_THREADS_SAFE, stale exited threads are never deleted. This is not a big deal -- I can't think of any way this might be user visible, other than gdb's memory growing a tiny bit whenever a thread gets stuck in exited state. Still, might as well clean things up properly. All other targets use prune_threads, so are unaffected. The fix adds a ALL_THREADS_SAFE macro, that like ALL_NON_EXITED_THREADS_SAFE, walks the thread list and allows deleting the iterated thread, and uses that in places that are walking the thread list in order to delete threads. Actually, after converting linux-nat.c and remote.c to use this, we find the only other user of ALL_NON_EXITED_THREADS_SAFE is also walking the list to delete threads. So we convert that too, and end up deleting ALL_NON_EXITED_THREADS_SAFE. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ChangeLog 2015-04-07 Pedro Alves <palves@redhat.com> * gdbthread.h (ALL_NON_EXITED_THREADS_SAFE): Rename to ... (ALL_THREADS_SAFE): ... this, and don't skip exited threads. (delete_exited_threads): New declaration. * infrun.c (follow_exec): Use ALL_THREADS_SAFE. * linux-nat.c (linux_nat_update_thread_list): New function. (linux_nat_add_target): Install it. * remote.c (remote_update_thread_list): Use ALL_THREADS_SAFE. * thread.c (prune_threads): Use ALL_THREADS_SAFE. (delete_exited_threads): New function.
2015-04-07Modify get_reloc_section for targets that map .got.plt to .gotAlan Modra13-10/+37
Fixes tic6x testsuite failures due to .rela.plt having a zero sh_info. I considered passing link_info to get_reloc_section so we could directly return the .got.plt output section, but we need the fallback to name lookup anyway for objcopy. bfd/ * elf.c (_bfd_elf_get_reloc_section): Allow for .got.plt being mapped to output .got section. ld/testsuite/ * ld-arm/tls-gdesc-nlazy.g: Adjust for readelf note. * ld-tic6x/shlib-1.rd: Expect corrected .rela.plt sh_info. * ld-tic6x/shlib-1b.rd: Likewise. * ld-tic6x/shlib-1r.rd: Likewise. * ld-tic6x/shlib-1rb.rd: Likewise. * ld-tic6x/shlib-app-1.rd: Likewise. * ld-tic6x/shlib-app-1b.rd: Likewise. * ld-tic6x/shlib-app-1r.rd: Likewise. * ld-tic6x/shlib-app-1rb.rd: Likewise. * ld-tic6x/shlib-noindex.rd: Likewise.
2015-04-07Cast shift expressionAlan Modra2-1/+6
PR ld/18176 * ldlang.c (lang_size_sections): Cast shift expression.
2015-04-07PowerPC non-PIC to PIC editing for protected var accessAlan Modra5-41/+257
This is a linker-only solution to the incompatibility between shared library protected visibility variables and using .dynbss and copy relocs for non-PIC access to shared library variables. bfd/ * elf32-ppc.c (struct ppc_elf_link_hash_entry): Add has_addr16_ha and has_addr16_lo. Make has_sda_refs a bitfield. (ppc_elf_check_relocs): Set new flags. (ppc_elf_link_hash_table_create): Update default_params. (ppc_elf_adjust_dynamic_symbol): Clear protected_def in cases where we won't be making .dynbss entries or editing code. Set params->pic_fixup when we'll edit code for protected var access. (allocate_dynrelocs): Allocate got entry for edited code and discard dyn_relocs. (struct ppc_elf_relax_info): Add picfixup_size. (ppc_elf_relax_section): Rename struct one_fixup to struct one_branch_fixup. Rename fixups to branch_fixups. Size space for pic fixups. (ppc_elf_relocate_section): Edit non-PIC accessing protected visibility variables to PIC. Don't emit dyn_relocs for code we've edited. * elf32-ppc.h (struct ppc_elf_params): Add pic_fixup. ld/ * emultempl/ppc32elf.em: Handle --no-pic-fixup. (params): Init new field. (ppc_before_allocation): Enable relaxation for pic_fixup.
2015-04-07Displaced stepping debug: fetch the right regcachePedro Alves2-1/+6
Although not currently possible in practice when we get here, 'resume_ptid' can also be a wildcard throughout this function. It's clearer to fetch the regcache using the thread's ptid. gdb/ChangeLog: 2015-04-07 Pedro Alves <pedro@codesourcery.com> * infrun.c (resume) <displaced stepping debug output>: Get the leader thread's regcache, not resume_ptid's.
2015-04-07Properly set alarm value in gdb.threads/non-stop-fair-events.expYao Qi3-3/+17
Nowadays, the alarm value is 60, and alarm is generated on some slow boards. This patch is to pass DejaGNU timeout value to the program, and move the alarm call before going to infinite loop. If any thread has activities, the alarm is reset. gdb/testsuite: 2015-04-07 Yao Qi <yao.qi@linaro.org> * gdb.threads/non-stop-fair-events.c (SECONDS): New macro. (child_function): Call alarm. (main): Move call to alarm into the loop. * gdb.threads/non-stop-fair-events.exp: Build program with -DTIMEOUT=$timeout.
2015-04-07Treat assembler generated local labels as local.Nick Clifton2-0/+9
* elf.c (_bfd_elf_is_local_label_name): Treat assembler generated local labels as local.
2015-04-06sim: move sim-engine.o/sim-hrw.o to the common listMike Frysinger46-35/+100
This makes these two objects available to all sims by default.
2015-04-07Automatic date update in version.inGDB Administrator1-1/+1
2015-04-06Fix the signature of a virtual method to match the one in the parent class.Rafael Ávila de Espíndola2-6/+8
2015-04-06Avoid a call to find by using the return value of insert.Rafael Ávila de Espíndola2-9/+7
2015-04-06Avoid a copy constructor call.Rafael Ávila de Espíndola2-2/+8
2015-04-06Remove is_zlib_supportedH.J. Lu11-36/+21
Since zlib is always supported, there is no need for is_zlib_supported. binutils/testsuite/ * binutils-all/compress.exp: Remove is_zlib_supported check. * binutils-all/objdump.exp: Likewise. * binutils-all/readelf.exp (readelf_compressed_wa_test): Likewise. * lib/utils-lib.exp (run_dump_test): Likewise. * lib/binutils-common.exp (is_zlib_supported): Removed. gas/testsuite/ * lib/gas-defs.exp (run_dump_test): Remove is_zlib_supported check. ld/testsuite/ * ld-elf/compress.exp: Remove is_zlib_supported check. Fail if --compress-debug-sections doesn't work. * lib/ld-lib.exp (run_dump_test): Remove is_zlib_supported check.
2015-04-06x86: Use individual prefix control for each opcode.Ilya Tocar3-1914/+1941
2015-04-06 Ilya Tocar <ilya.tocar@intel.com> H.J. Lu <hongjiu.lu@intel.com> * i386-dis-evex.h (evex_table): Fill prefix_requirement field. * i386-dis.c (PREFIX_MANDATORY_REPZ, PREFIX_MANDATORY_REPNZ, PREFIX_MANDATORY_DATA, PREFIX_MANDATORY_ADDR, PREFIX_MANDATORY_LOCK, PREFIX_UD_SHIFT, PREFIX_UD_REPZ, REFIX_UD_REPNZ, PREFIX_UD_DATA, PREFIX_UD_ADDR, PREFIX_UD_LOCK, PREFIX_OPTIONAL, PREFIX_MANDATORY): Define. (Bad_Opcode, FLOAT, DIS386, DIS386_PREFIX, THREE_BYTE_TABLE_PREFIX): Fill prefix_requirement field. (struct dis386): Add prefix_requirement field. (dis386): Fill prefix_requirement field. (dis386_twobyte): Ditto. (twobyte_has_mandatory_prefix_: Remove. (reg_table): Fill prefix_requirement field. (prefix_table): Ditto. (x86_64_table): Ditto. (three_byte_table): Ditto. (xop_table): Ditto. (vex_table): Ditto. (vex_len_table): Ditto. (vex_w_table): Ditto. (mod_table): Ditto. (bad_opcode): Ditto. (print_insn): Use prefix_requirement. (FGRPd9_2, FGRPd9_4, FGRPd9_5, FGRPd9_6, FGRPd9_7, FGRPda_5, FGRPdb_4, FGRPde_3, FGRPdf_4): Fill prefix_requirement field. (float_reg): Ditto.
2015-04-06Use bfd_putb64/bfd_getb64H.J. Lu4-39/+16
bfd/ * compress.c (get_uncompressed_size): Removed. (bfd_compress_section_contents): Use bfd_putb64 to write uncompressed section size. (bfd_init_section_decompress_status): Replace get_uncompressed_size with bfd_getb64. gas/ * write.c (compress_debug): Use bfd_putb64 to write uncompressed section size.
2015-04-06Remove "/dev/null" from remote_execH.J. Lu2-1/+6
We should catch all errors/warnings from cmp. * binutils-all/compress.exp (compression_used): Remove "/dev/null" from remote_exec.
2015-04-06Add testcase for stub-method reading in stabs.Doug Evans3-1/+65
This patch is based on the testcase provided here: https://sourceware.org/ml/gdb-patches/2015-02/msg00181.html I've verified that it catches the internal error discovered here: https://sourceware.org/ml/gdb-patches/2015-02/msg00139.html gdb/testsuite/ChangeLog: * lib/gdb.exp (clean_restart): Return result of gdb_load. * gdb.pascal/stub-method.exp: New file. * gdb.pascal/stub-method.pas: New file.
2015-04-06* lib/pascal.exp (gpc_compile): Rename dest arg to destfile.Doug Evans2-8/+19
The "dest" parameter to fpc_compile/gpc_compile is the name of compilation destination file, not a board name. This patch fixes this by using names consistent with lib/future.exp:gdb_default_target_compile. gdb/testsuite/ChangeLog: * lib/pascal.exp (gpc_compile): Rename dest arg to destfile. Fix dest parameter to board_info. (fpc_compile): Ditto. (gdb_compile_pascal): Rename dest arg to destfile.
2015-04-06symtab.c (hash_symbol_entry): Hash STRUCT_DOMAIN symbols as VAR_DOMAIN.Doug Evans2-9/+27
gdb/ChangeLog: * symtab.c (hash_symbol_entry): Hash STRUCT_DOMAIN symbols as VAR_DOMAIN. (symbol_cache_lookup): Clarify use of bsc_ptr, slot_ptr parameters. Include symbol domain in debugging output.
2015-04-06Fallback to stub-termcap.c on all hostsPedro Alves4-13/+31
Currently building gdb is impossible without an installed termcap or curses library. But, GDB already has a very minimal termcap in the tree to handle this situation for Windows -- gdb/stub-termcap.c. This patch makes that the fallback for all hosts. Testing this on GNU/Linux (by simply hacking away the termcap/curses detection in gdb/configure.ac), we trip on: ../readline/libreadline.a(terminal.o): In function `_rl_init_terminal_io': /home/pedro/gdb/mygit/src/readline/terminal.c:527: undefined reference to `PC' /home/pedro/gdb/mygit/src/readline/terminal.c:528: undefined reference to `BC' /home/pedro/gdb/mygit/src/readline/terminal.c:529: undefined reference to `UP' /home/pedro/gdb/mygit/src/readline/terminal.c:538: undefined reference to `PC' /home/pedro/gdb/mygit/src/readline/terminal.c:539: undefined reference to `BC' /home/pedro/gdb/mygit/src/readline/terminal.c:540: undefined reference to `UP' These are globals that are normally defined by termcap (or ncurses' termcap emulation). Now, we could just define replacements in stub-termcap.c, but readline/terminal.c (at least the copy in our tree) has this: #if !defined (__linux__) && !defined (NCURSES_VERSION) # if defined (__EMX__) || defined (NEED_EXTERN_PC) extern # endif /* __EMX__ || NEED_EXTERN_PC */ char PC, *BC, *UP; #endif /* !__linux__ && !NCURSES_VERSION */ which can result in readline defining the globals too. That will usually work out in C, given that "-fcommon" is usually the default for C compilers, but that won't work for C++, or C with -fno-common (link fails with "multiple definition" errors)... Mirroring those #ifdef conditions in the stub termcap screams "brittle" to me -- I can see them changing in latter readline versions. Work around that by simply using __attribute__((weak)). Windows/PE/COFF's do support weak, but not on gcc 3.4 based toolchains (4.8.x does work). Given the file never needed the variables while it was Windows-only, just continue not defining them there. All other supported hosts should support this. gdb/ChangeLog: 2015-04-06 Pedro Alves <palves@redhat.com> Bernd Edlinger <bernd.edlinger@hotmail.de> * configure.ac: Remove the mingw32-specific stub-termcap.o fallback, and instead fallback to the stub termcap on all hosts. * configure: Regenerate. * stub-termcap.c [!__MINGW32__] (PC, BC, UP): Define as weak symbols.
2015-04-06[Gold,x86_64] Convert mov foo@GOTPCREL(%rip), %reg to lea foo(%rip), %regIlya Tocar8-6/+275
2015-04-06 Ilya Tocar <ilya.tocar@intel.com> PR gold/17641 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New. (Target_x86_64::Scan::local): Don't create GOT entry, when we can convert mov to lea. (Target_x86_64::Scan::global): Ditto. (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip), %reg to lea foo(%rip), %reg if possible. * testsuite/Makefile.am (x86_64_mov_to_lea): New test. * testsuite/x86_64_mov_to_lea1.s: New. * testsuite/x86_64_mov_to_lea2.s: Ditto. * testsuite/x86_64_mov_to_lea3.s: Ditto. * testsuite/x86_64_mov_to_lea4.s: Ditto. * testsuite/x86_64_mov_to_lea.sh: Ditto. ---
2015-04-06Automatic date update in version.inGDB Administrator1-1/+1
2015-04-05Add SHF_COMPRESSED support to readelfH.J. Lu2-6/+82
This patch updates readelf to dump compression header with readelf -S -W: [ 4] .debug_info PROGBITS 00000000 000038 00007d 00 C 0 0 1 readelf -t -W: [ 4] .debug_info PROGBITS 00000000 000038 00007d 00 0 0 1 [00000800]: COMPRESSED ZLIB, 0000009d, 1 It also checks the compression header when decompressing the compressed section. * readelf.c (get_elf_section_flags): Support SHF_COMPRESSED. (get_compression_header): New. (process_section_headers): Dump compression header if needed. (uncompress_section_contents): Don't free compressed_buffer here. (load_specific_debug_section): Free the compressed buffer, update the section buffer and the section size if uncompress is successful.
2015-04-05Xfail the compressed debug sectionsH.J. Lu4-1/+23
There is no need to generate compressed debug section if compressed section size is the same as before compression. We should xfail the compressed debug section test if there are no compressed sections binutils/testsuite/ * binutils-all/compress.exp (compression_used): New. Xfail test if compression didn't make the section smaller. gas/ 2015-04-05 H.J. Lu <hongjiu.lu@intel.com> * write.c (compress_debug): Don't write the zlib header if compressed section size is the same as before compression.
2015-04-05sim: moxie: fix running after nrun conversionMike Frysinger7-25/+102
The nrun conversion was slightly incorrect in how it stopped when an exception occurred. We still set cpu.asregs.exception, but nothing was checking it anymore. Convert all of that to sim_engine_halt. To keep things from regressing again, add a basic testsuite too.
2015-04-05sim: mn10300: add a basic testsuiteMike Frysinger4-0/+88
2015-04-05sim: m68hc11: add a basic testsuiteMike Frysinger4-0/+78
2015-04-05sim: iq2000: add a basic testsuiteMike Frysinger4-0/+78
2015-04-05sim: lm32: add a basic testsuiteMike Frysinger4-0/+84
2015-04-05Automatic date update in version.inGDB Administrator1-1/+1
2015-04-04Also preserve the SHF_COMPRESSED bitH.J. Lu2-0/+10
For objcopy and relocatable link, we should also preserve the SHF_COMPRESSED bit if not decompress. * elf.c (_bfd_elf_init_private_section_data): Also preserve the SHF_COMPRESSED bit if not decompress.
2015-04-04Replace uncompressed_size_buffer with compressed_size_bufferH.J. Lu1-9/+9
2015-04-04Extract get_uncompressed_sizeH.J. Lu2-9/+27
* compress.c (get_uncompressed_size): New. Extracted from ... (bfd_init_section_decompress_status): This. Use it.
2015-04-04Add a dw2-3.S testH.J. Lu6-26/+544
This patch adds a dw2-3.S test for upcoming SHF_COMPRESSED test. The existing dw2-1.S/dw2-2.S tests generate non-compressed debug sections for SHF_COMPRESSED since SHF_COMPRESSED compressed debug sections are bigger. * binutils-all/compress.exp (testfile): Remove suffix. (compressedfile): Likewise. (compressedfile2): Likewise. (libfile): Likewise. (testfile3): New. (compressedfile3): Likewise. Updated. Add a dw2-3.S test. * binutils-all/dw2-3.S: New file. * binutils-all/dw2-3.W: Likewise.
2015-04-04Automatic date update in version.inGDB Administrator1-1/+1
2015-04-03Add Elf_Internal_Chdr and ElfXX_External_ChdrH.J. Lu3-0/+28
* external.h (Elf32_External_Chdr): New. (Elf64_External_Chdr): Likewise. * internal.h (Elf_Internal_Chdr): Likewise.
2015-04-03gdbtypes.c: remove the usuned "top_level" parameterPierre-Marie de Rodat2-16/+27
This paramater is no longer useful after the previous commit, so remove it as a cleanup. gdb/ChangeLog: * gdbtypes.c (is_dynamic_type_internal): Remove the unused "top_level" parameter. (resolve_dynamic_type_internal): Remove the unused "top_level" parameter. Update call to is_dynamic_type_internal. (is_dynamic_type): Update call to is_dynamic_type_internal. (resolve_dynamic_range): Update call to resolve_dynamic_type_internal. (resolve_dynamic_union): Likewise. (resolve_dynamic_struct): Likewise. (resolve_dynamic_type): Likewise.
2015-04-03Do not consider reference types as dynamicPierre-Marie de Rodat5-19/+90
Even when referenced types are dynamic, the corresponding referencing type should not be considered as dynamic: it's only a pointer. This prevents reference type for values not in memory to be resolved. gdb/ChangeLog: * gdbtypes.c (is_dynamic_type_internal): Remove special handling of TYPE_CODE_REF types so that they are not considered as dynamic depending on the referenced type. (resolve_dynamic_type_internal): Likewise. gdb/testsuite/ChangeLog: * gdb.ada/funcall_ref.exp: New file. * gdb.ada/funcall_ref/foo.adb: New file.
2015-04-03Make is_zlib_supported always return 1H.J. Lu2-21/+5
* lib/binutils-common.exp (is_zlib_supported): Always return 1.
2015-04-02sim: d10v: fix signal updatesMike Frysinger2-8/+11
Way back in aba6488e0b73756f31f154d12a228baa82a68d8a, a bunch of signal defines were changed to TARGET_SIGNAL_xxx. For d10v, the transition was incomplete which lead to sim_stop_reason using the new set but sim_resume still using the old set. Which meant in some cases, the sim would never actually stop. Convert all the remaining SIGxxx defines in here to TARGET_SIGNAL_xxx. This has the nice side effect of fixing the testsuite.
2015-04-03Automatic date update in version.inGDB Administrator1-1/+1
2015-04-02Second fix for microblaze gas port's ability to parse constants.Nick Clifton2-5/+11
PR gas/18189 * config/tc-microblaze.c (parse_imm): Use offsetT as the type for min and max parameters. Sign extend values before testing.
2015-04-02Fixes a bug in the microblaze assembler where it would not complain about ↵Nick Clifton2-5/+11
constants larger than 32-bits. PR gas/18189 * config/tc-microblaze.c (parse_imm): Use offsetT as the type for min and max parameters.
2015-04-02Fix the binutils readelf.ss test for the AArch64 target.Nick Clifton2-0/+7
* binutils-all/readelf.ss-64: Move possible location of the $d mapping symbol.
2015-04-02Add support for configuring an aarch64-freebsd target.Andrew Turner8-0/+80
ld * Makefile.am: Add FreeBSD aarch64 files. * Makefile.in: Regenerate. * configure.tgt: Add aarch64-*-freebsd* target triple. * emulparams/aarch64fbsd.sh: New file. * emulparams/aarch64fbsdb.sh: New file. bfd * config.bfd: Add aarch64-*-freebsd* target triple.
2015-04-02[AArch64] Emit DATA_MAP in order within text sectionRenlin Li2-19/+42
2015-03-27 Renlin Li <renlin.li@arm.com> gas/ * config/tc-aarch64.c (mapping_state): Emit MAP_DATA within text section in order. (mapping_state_2): Don't emit MAP_DATA here. (s_aarch64_inst): Align frag during state transition. (md_assemble): Likewise.
2015-04-02Remove unused functions in tc-aarch64.c.Ed Maste2-12/+5
* config/tc-aarch64.c (set_error_kind): Delete. (set_error_message): Delete.
2015-04-02kfail two tests in no-unwaited-for-left.exp for remote targetYao Qi2-0/+11
I see these two fails in no-unwaited-for-left.exp in remote testing for aarch64-linux target. ... continue Continuing. warning: Remote failure reply: E.No unwaited-for children left. [Thread 1084] #2 stopped. (gdb) FAIL: gdb.threads/no-unwaited-for-left.exp: continue stops when thread 2 exits .... continue Continuing. warning: Remote failure reply: E.No unwaited-for children left. [Thread 1081] #1 stopped. (gdb) FAIL: gdb.threads/no-unwaited-for-left.exp: continue stops when the main thread exits I checked the gdb.log on buildbot, and find that these two fails also appear on Debian-i686-native-extended-gdbserver and Fedora-ppc64be-native-gdbserver-m64. I recall that they are about local/remote parity, and related RSP is missing. There has been already a PR 14618 about it. This patch is to kfail them on remote target. gdb/testsuite: 2015-04-02 Yao Qi <yao.qi@linaro.org> * gdb.threads/no-unwaited-for-left.exp: Set up kfail if target is remote.
2015-04-02Regenerate configure in bfd/binutils/gas/gdb/goldH.J. Lu11-10/+32
bfd/ * configure: Regenerated. binutils/ * configure: Regenerated. gas/ * configure: Regenerated. gdb/ * Makefile.in (top_srcdir): New. * configure: Regenerated. gold/ * configure: Regenerated.