and though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here

  1. 06 Jul, 2015 2 commits
  2. 30 Jun, 2015 6 commits
    • H.J. Lu's avatar
    • Nick Clifton's avatar
      Add support for SADDR addressing to the RL78 port. · 54f66250
      Nick Clifton authored
      gas	* config/rl78-parse.y: Tag all saddr expressions throughout.
      	(SET_SA): New.
      	(expr_is_saddr): Allow symbolic expressions.
      	* config/tc-rl78.c (md_apply_fix): Handle SADDR.
      
      bfd	* elf32-rl78.c (rl78_elf_howto_table): Add RH_SADDR.
              (rl78_reloc_map): Add R_RL78_RH_SADDR.
      	* reloc.c: Add BFD_RELOC_RL78_SADDR.
      	* libbfd.h: Regenerate.
      	* bfd-in2.h: Regenerate.
      54f66250
    • Yao Qi's avatar
      Handle media instructions in arm software single step. · 7b9be803
      Yao Qi authored
      This patch fixes PR 18605 which is about incorrectly decoding media
      instructions in software single step.
      
      gdb:
      
      2015-06-30  Yao Qi  <yao.qi@linaro.org>
      
      	PR tdep/18605
      	* arm-tdep.c (arm_get_next_pc_raw): Break for media
      	instructions.
      7b9be803
    • Kevin Buettner's avatar
      Turn on dwarf2 unwinding for Renesas RX architecture · fd6e021d
      Kevin Buettner authored
      This change turns on dwarf2 unwinding in rx-tdep.c.  I found it
      necessary to add rx_dwarf_reg_to_regnum in order to cause PC to be
      mapped correctly.
      
      gdb/ChangeLog:
      
      	* rx-tdep.c (RX_PSW_REGNUM): New enum constant.
      	(rx_dwarf_reg_to_regnum): New function.
      	(rx_gdbarch_init): Register rx_dwarf_reg_to_regnum.  Use dwarf2
      	unwinding.
      fd6e021d
    • Han Shen's avatar
      Patch for gold internal error while fixing erratum 843419. · 56b06706
      Han Shen authored
      The crash reason is that the insn to be moved to stub may be a
      relocation spot, so instead of placing the origin insn (that is insn
      before-relocation) to the stub, I have to place the relocated one.
      Note the relocation involved is non-pc-relative, so it is safe to move
      the relocated insn.
      
      gold/ChangeLog:
      2015-06-29  Han Shen  <shenhan@google.com>
      
          * AArch64.cc (Erratum_stub::Insn_utilities): New typedef.
          (Erratum_stub::update_erratum_insn): New method.
          (Stub_table::relocate_stubs): Modified to place relocated insn.
          (AArch64_relobj::fix_errata): Modified gold_assert.
      56b06706
    • GDB Administrator's avatar
      Automatic date update in version.in · 06b3fd23
      GDB Administrator authored
      06b3fd23
  3. 29 Jun, 2015 6 commits
    • Pedro Alves's avatar
      PR threads/18127 - threads spawned by infcall end up stuck in "running" state · 28bf096c
      Pedro Alves authored
      Refs:
       https://sourceware.org/ml/gdb/2015-03/msg00024.html
       https://sourceware.org/ml/gdb/2015-06/msg00005.html
      
      On GNU/Linux, if an infcall spawns a thread, that thread ends up with
      stuck running state.  This happens because:
      
       - when linux-nat.c detects a new thread, it marks them as running,
         and does not report anything to the core.
      
       - we skip finish_thread_state when the thread that is running the
         infcall stops.
      
      As result, that new thread ends up with stuck "running" state, even
      though it really is stopped.
      
      On Windows, _all_ threads end up stuck in running state, not just the
      one that was spawned.  That happens because when a new thread is
      detected, unlike linux-nat.c, windows-nat.c reports
      TARGET_WAITKIND_SPURIOUS to infrun.  It's the fact that that event
      does not cause a user-visible stop that triggers the problem.  When
      the target is re-resumed, we call set_running with a wildcard ptid,
      which marks all thread as running.  That set_running is not suppressed
      because the (leader) thread being resumed does not have in_infcall
      set.  Later, when the infcall finally finishes successfully, nothing
      marks all threads back to stopped.
      
      We can trigger the same problem on all targets by having a thread
      other than the one that is running the infcall report a breakpoint hit
      to infrun, and then have that breakpoint not cause a stop.  That's
      what the included test does.
      
      The fix is to stop GDB from suppressing the set_running calls while
      doing an infcall, and then set the threads back to stopped when the
      call finishes, iff they were originally stopped before the infcall
      started.  (Note the MI *running/*stopped event suppression isn't
      affected.)
      
      Tested on x86_64 GNU/Linux.
      
      gdb/ChangeLog:
      2015-06-29  Pedro Alves  <palves@redhat.com>
      
      	PR threads/18127
      	* infcall.c (run_inferior_call): On infcall success, if the thread
      	was marked stopped before, reset it back to stopped.
      	* infrun.c (resume): Don't suppress the set_running calls when
      	doing an infcall.
      	(normal_stop): Only discard the finish_thread_state cleanup if the
      	infcall succeeded.
      
      gdb/testsuite/ChangeLog:
      2015-06-29  Pedro Alves  <palves@redhat.com>
      
      	PR threads/18127
      	* gdb.threads/hand-call-new-thread.c: New file.
      	* gdb.threads/hand-call-new-thread.c: New file.
      28bf096c
    • Pierre Langlois's avatar
      Fix email in ChangeLog entry. · 2880b51c
      Pierre Langlois authored
      2880b51c
    • Pierre Langlois's avatar
      [GDBServer][AArch64] Enable support for Z0 packets · 96c97461
      Pierre Langlois authored
      This patch lets GDBServer handle software breakpoints instead of relying
      on GDB.
      
      gdb/gdbserver/ChangeLog:
      
      	* linux-aarch64-low.c (aarch64_supports_z_point_type): Enable for
      	Z_PACKET_SW_BP.
      96c97461
    • Pierre Langlois's avatar
      [GDBServer][AArch64] Use the same break instruction as GDB · 37d66942
      Pierre Langlois authored
      GDB uses a "brk #0" instruction to perform a software breakpoint while
      GDBServer uses an illegal instruction.  Both instructions should match.
      
      When enabling support for the 'Z0' packet, we let GDBServer insert the
      breakpoint instruction instead of GDB.  And in case of permanent
      breakpoints for example, GDB will check if a breakpoint is inserted in the
      inferior with `program_breakpoint_here_p (gdbarch, address)', and
      compare the instruction read from the inferior with the breakpoint
      instruction.
      
      On AArch64, instructions are always little endian so we need to
      represent it as an array of bytes, as done in aarch64-tdep.c.
      
      gdb/gdbserver/ChangeLog:
      
      	* linux-aarch64-low.c: Remove comment about endianness.
      	(aarch64_breakpoint): Change type to gdb_byte[].  Set to "brk #0".
      	(aarch64_breakpoint_at): Change type of insn to gdb_byte[].  Use
      	memcmp.
      37d66942
    • Pierre Langlois's avatar
      Update my email address · 1451ea7d
      Pierre Langlois authored
      gdb/ChangeLog:
      
      	* MAINTAINERS (Write After Approval): Update my email address.
      1451ea7d
    • GDB Administrator's avatar
      Automatic date update in version.in · bb0eef66
      GDB Administrator authored
      bb0eef66
  4. 28 Jun, 2015 7 commits
    • Nick Clifton's avatar
      Add support for ARM v6 instructions. · 73cb0348
      Nick Clifton authored
      	* Makefile.in (SIM_EXTRA_CFLAGS): Add -lm.
      	* armdefs.h (ARMdval, ARMfval): New types.
      	(ARM_VFP_reg): New union.
      	(struct ARMul_State): Add VFP_Reg and FPSCR fields.
      	(VFP_fval, VFP_uword, VFP_sword, VFP_dval, VFP_dword): Accessor
      	macros for the new VFP_Reg field.
      	* armemu.c (handle_v6_insn): Add code to handle MOVW, MOVT,
      	QADD16, QASX, QSAX, QSUB16, QADD8, QSUB8, UADD16, USUB16, UADD8,
      	USUB8, SEL, REV, REV16, RBIT, BFC, BFI, SBFX and UBFX
      	instructions.
      	(handle_VFP_move): New function.
      	(ARMul_Emulate16): Add checks for newly supported v6
      	instructions.  Add support for VMRS, VMOV and MRC instructions.
      	(Multiply64): Allow nRdHi == nRm and/or nRdLo == nRm when
      	operating in v6 mode.
      	* armemu.h (t_resolved): Define.
      	* armsupp.c: Include math.h.
      	(handle_VFP_xfer): New function.  Handles VMOV, VSTM, VSTR, VPUSH,
      	VSTM, VLDM and VPOP instructions.
      	(ARMul_LDC): Test for co-processor 10 or 11 and pass call to the
      	new handle_VFP_xfer function.
      	(ARMul_STC): Likewise.
      	(handle_VFP_op): New function.  Handles VMLA, VMLS, VNMLA, VNMLS,
      	VNMUL, VMUL, VADD, VSUB, VDIV, VMOV, VABS, VNEG, VSQRT, VCMP,
      	VCMPE and VCVT instructions.
      	(ARMul_CDP): Test for co-processor 10 or 11 and pass call to the
      	new handle_VFP_op function.
      	* thumbemu.c (tBIT, tBITS, ntBIT, ntBITS): New macros.
      	(test_cond): New function.  Tests a condition and returns non-zero
      	if the condition has been met.
      	(handle_IT_block): New function.
      	(in_IT_block): New function.
      	(IT_block_allow): New function.
      	(ThumbExpandImm): New function.
      	(handle_T2_insn): New function.  Handles T2 thumb instructions.
      	(handle_v6_thumb_insn): Add next_instr and pc parameters.
      	(ARMul_ThumbDecode): Add support for IT blocks.  Add support for
      	v6 instructions.
      	* wrapper.c (sim_create_inferior): Detect a thumb address and call
      	SETT appropriately.
      73cb0348
    • H.J. Lu's avatar
      Update binutils-pr18322.patch · 9fd85772
      H.J. Lu authored
      9fd85772
    • H.J. Lu's avatar
      Update binutils-pr18321.patch · 8206bbf8
      H.J. Lu authored
      8206bbf8
    • H.J. Lu's avatar
      Remove binutils-pr18451.patch · be87e6fe
      H.J. Lu authored
      It has been applied to master branch.
      be87e6fe
    • H.J. Lu's avatar
    • H.J. Lu's avatar
      Remove COMPRESS_DEBUG_ZLIB · ee0c0c50
      H.J. Lu authored
      COMPRESS_DEBUG_ZLIB isn't needed.  This patch removes COMPRESS_DEBUG_ZLIB
      and replace COMPRESS_DEBUG_ZLIB with COMPRESS_DEBUG_GNU_ZLIB.
      
      bfd/
      
      	* bfd-in.h (compressed_debug_section_type): Remove
      	COMPRESS_DEBUG_ZLIB.
      	* bfd-in2.h : Regenerated.
      gas/
      
      	* as.c (parse_args): Replace COMPRESS_DEBUG_ZLIB with
      	COMPRESS_DEBUG_GNU_ZLIB.
      	* config/tc-i386.c (flag_compress_debug): Likewise.
      
      ld/
      
      	* emultempl/elf32.em  (gld${EMULATION_NAME}_handle_option):
      	Replace COMPRESS_DEBUG_ZLIB with COMPRESS_DEBUG_GNU_ZLIB.
      ee0c0c50
    • GDB Administrator's avatar
      Automatic date update in version.in · e44fbadb
      GDB Administrator authored
      e44fbadb
  5. 27 Jun, 2015 3 commits
  6. 26 Jun, 2015 7 commits
    • Keith Seitz's avatar
      PR 16253 revisited · ee93cd5e
      Keith Seitz authored
      Last year a patch was submitted/approved/commited to eliminate
      symbol_matches_domain which was causing this problem.  It was later reverted
      because it introduced a (severe) performance regression.
      
      Recap:
      
      (gdb) list
      1	enum e {A,B,C} e;
      2	int main (void) { return 0; }
      3
      (gdb) p e
      Attempt to use a type name as an expression
      
      The parser attempts to find a symbol named "e" of VAR_DOMAIN.
      This gets passed down through lookup_symbol and (eventually) into
      block_lookup_symbol_primary, which iterates over the block's dictionary
      of symbols:
      
        for (sym = dict_iter_name_first (block->dict, name, &dict_iter);
             sym != NULL;
             sym = dict_iter_name_next (name, &dict_iter))
          {
            if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
                                       SYMBOL_DOMAIN (sym), domain))
              return sym;
          }
      
      The problem here is that we have a symbol named "e" in both STRUCT_DOMAIN
      and VAR_DOMAIN, and for languages like C++, Java, and Ada, where a tag name
      may be used as an implicit typedef of the type, symbol_matches_domain ignores
      the difference between VAR_DOMAIN and STRUCT_DOMAIN.  As it happens, the
      STRUCT_DOMAIN symbol is found first, considered a match, and that symbol is
      returned to the parser, eliciting the (now dreaded) error message.
      
      Since this bug exists specifically because we have both STRUCT and VAR_DOMAIN
      symbols in a given block/CU, this patch rather simply/naively changes
      block_lookup_symbol_primary so that it continues to search for an exact
      domain match on the symbol if symbol_matches_domain returns a symbol
      which does not exactly match the requested domain.
      
      This "fixes" the immediate problem, but admittedly might uncover other,
      related bugs.  [Paranoia?] However, it causes no regressions (functional
      or performance) in the test suite.  A similar change has been made
      to block_lookup_symbol for other cases in which this bug might appear.
      
      The tests from the previous submission have been resurrected and updated.
      However since we can still be given a matching symbol with a different domain
      than requested, we cannot say that a symbol "was not found."  The error
      messages today will still be the (dreaded) "Attempt to use a type name..."
      
      ChangeLog
      
      	PR 16253
      	* block.c (block_lookup_symbol): For non-function blocks,
      	continue to search for a symbol with an exact domain match
      	Otherwise, return any previously found "best domain" symbol.
      	(block_lookup_symbol_primary): Likewise.
      
      testsuite/ChangeLog
      
      	PR 16253
      	* gdb.cp/var-tag-2.cc: New file.
      	* gdb.cp/var-tag-3.cc: New file.
      	* gdb.cp/var-tag-4.cc: New file.
      	* gdb.cp/var-tag.cc: New file.
      	* gdb.cp/var-tag.exp: New file.
      ee93cd5e
    • Patrick Palka's avatar
      Add option to remove duplicate command history entries · fc637f04
      Patrick Palka authored
      This patch implements the new option "history remove-duplicates", which
      controls the removal of duplicate history entries ("off" by default).
      
      The motivation for this option is to be able to reduce the prevalence of
      basic commands such as "up" and "down" in the history file.  These
      common commands crowd out more unique commands in the history file (when
      the history file has a fixed size), and they make navigation of the
      history file via ^P, ^N and ^R more inconvenient.
      
      The option takes an integer denoting the number of history entries to
      look back at for a history entry that is a duplicate of the latest one.
      "history remove-duplicates 1" is equivalent to bash's ignoredups option,
      and "history remove-duplicates unlimited" is equivalent to bash's
      erasedups option.
      
      [ I decided to go with this integer approach instead of a tri-state enum
        because it's slightly more flexible and seemingly more intuitive than
        leave/erase/ignore.  ]
      
      gdb/ChangeLog:
      
      	* NEWS: Mention the new option "history remove-duplicates".
      	* top.c (history_remove_duplicates): New static variable.
      	(show_history_remove_duplicates): New static function.
      	(gdb_add_history): Conditionally remove duplicate history
      	entries.
      	(init_main): Add "history remove-duplicates" option.
      
      gdb/doc/ChangeLog:
      
      	* gdb.texinfo (Command History): Document the new option
      	"history remove-duplicates".
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.base/history-duplicates.exp: New test.
      fc637f04
    • Patrick Palka's avatar
      Add tab completion for TUI's "focus" command · 2e52ae68
      Patrick Palka authored
      The implementation is pretty straightforward, with the only caveat being
      that the "src", "cmd", "next" and "prev" entries get delibrately added
      to the completion list even when the TUI has not yet been initialized
      (i.e. has never been enabled during the session), since invoking the
      "focus" command with these arguments already works when the TUI has not
      yet been initialized.
      
      gdb/ChangeLog:
      
      	* tui/tui-win.c (focus_completer): New static function.
      	(_initialize_tui_win): Set the completion function of the
      	"focus" command to focus_completer.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.base/completion.exp: Test the completion of the "focus"
      	command.
      2e52ae68
    • Jan Kratochvil's avatar
      Do not skip prologue for asm (.S) files · 6e22494e
      Jan Kratochvil authored
      GDB tries to skip prologue for .S files according to .debug_line but it then
      places the breakpoint to a location where it is never hit.
      
      This is because #defines in .S files cause prologue skipping which is
      completely inappropriate, for s390x:
      
      glibc/sysdeps/unix/syscall-template.S
      78:/* This is a "normal" system call stub: if there is an error,
      79:   it returns -1 and sets errno.  */
      80:
      81:T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
      82:     ret
      
      00000000000f4210 T __select
       Line Number Statements:
        Extended opcode 2: set Address to 0xf41c8
        Advance Line by 80 to 81
        Copy
        Advance PC by 102 to 0xf422e
        Special opcode 6: advance Address by 0 to 0xf422e and Line by 1 to 82
        Special opcode 34: advance Address by 2 to 0xf4230 and Line by 1 to 83
        Advance PC by 38 to 0xf4256
        Extended opcode 1: End of Sequence
        Compilation Unit @ offset 0x28b3e0:
       <0><28b3eb>: Abbrev Number: 1 (DW_TAG_compile_unit)
          <28b3ec>   DW_AT_stmt_list   : 0x7b439
          <28b3f0>   DW_AT_low_pc	 : 0xf41c8
          <28b3f8>   DW_AT_high_pc     : 0xf4256
          <28b400>   DW_AT_name        : ../sysdeps/unix/syscall-template.S
          <28b423>   DW_AT_comp_dir    : /usr/src/debug////////glibc-2.17-c758a686/misc
          <28b452>   DW_AT_producer    : GNU AS 2.23.52.0.1
          <28b465>   DW_AT_language    : 32769        (MIPS assembler)
      
      without debuginfo or with debuginfo and the fix - correct address:
      (gdb) b select
      Breakpoint 1 at 0xf4210
      
      It is also where .dynsym+.symtab point to:
      00000000000f4210 T __select
      00000000000f4210 W select
      
      with debuginfo, without the fix:
      (gdb) b select
      Breakpoint 1 at 0xf41c8: file ../sysdeps/unix/syscall-template.S, line 81.
      
      One part is to behave for asm files similar way like for 'locations_valid':
        /* Symtab has been compiled with both optimizations and debug info so that
           GDB may stop skipping prologues as variables locations are valid already
           at function entry points.  */
        unsigned int locations_valid : 1;
      
      The other part is to extend the 'locations_valid'-like functionality more.
      
      Both minsym_found and find_function_start_sal need to be patched, otherwise
      their addresses do not match and GDB regresses on ppc64:
      
      gdb/ChangeLog
      2015-06-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
      
      	* linespec.c (minsym_found): Reset sal.PC for COMPUNIT_LOCATIONS_VALID
      	and language_asm..
      	* symtab.c (find_function_start_sal): Likewise.
      
      gdb/testsuite/ChangeLog
      2015-06-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
      
      	* gdb.arch/amd64-prologue-skip.S: New file.
      	* gdb.arch/amd64-prologue-skip.exp: New file.
      6e22494e
    • H.J. Lu's avatar
      Compile-in IAMCU linker scripts · c742574f
      H.J. Lu authored
      	* emulparams/elf_iamcu.sh (COMPILE_IN): New.
      c742574f
    • Matthew Fortune's avatar
      Add support for DT_MIPS_RLD_MAP_REL. · a5499fa4
      Matthew Fortune authored
      This tag makes it possible to access the debug map when debugging position
      independent executables.
      
      bfd/
      
      	* elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Use executable
      	instead of !shared to indicate an application vs shared library.
      	(_bfd_mips_elf_size_dynamic_sections): Likewise.
      	(_bfd_mips_elf_finish_dynamic_sections): Handle DT_MIPS_RLD_MAP_REL.
      	(_bfd_mips_elf_get_target_dtag): Likewise.
      
      binutils/
      
      	* readelf.c (get_mips_dynamic_type): Handle DT_MIPS_RLD_MAP_REL.
      
      include/
      
      	* elf/mips.h (DT_MIPS_RLD_MAP_REL): New macro.
      
      ld/testsuite/
      
      	* ld-mips-elf/pic-and-nonpic-3b.ad: Adjust for extra dynamic tag.
      	* ld-mips-elf/pic-and-nonpic-4b.ad: Likewise.
      	* ld-mips-elf/pic-and-nonpic-5b.ad: Likewise.
      	* ld-mips-elf/pic-and-nonpic-6-n32.ad: Likewise.
      	* ld-mips-elf/pic-and-nonpic-6-n64.ad: Likewise.
      	* ld-mips-elf/pic-and-nonpic-6-o32.ad: Likewise.
      	* ld-mips-elf/tlsdyn-o32-1.d: Likewise.
      	* ld-mips-elf/tlsdyn-o32-1.got: Likewise.
      	* ld-mips-elf/tlsdyn-o32-2.d: Likewise.
      	* ld-mips-elf/tlsdyn-o32-2.got: Likewise.
      	* ld-mips-elf/tlsdyn-o32-3.d: Likewise.
      	* ld-mips-elf/tlsdyn-o32-3.got: Likewise.
      	* ld-mips-elf/tlsdyn-o32.d: Likewise.
      	* ld-mips-elf/tlsdyn-o32.got: Likewise.
      	* ld-mips-elf/pie-n32.d: New file.
      	* ld-mips-elf/pie-n64.d: Likewise.
      	* ld-mips-elf/pie-o32.d: Likewise.
      	* ld-mips-elf/pie.s: Likewise.
      	* ld-mips-elf/mips-elf.exp: Add new tests.
      a5499fa4
    • GDB Administrator's avatar
      Automatic date update in version.in · 920d644c
      GDB Administrator authored
      920d644c
  7. 25 Jun, 2015 9 commits
    • DJ Delorie's avatar
      Fix REL handling for MSP430 · 3f307074
      DJ Delorie authored
      * elf32-msp430.c (msp430_final_link_relocate): Fix comments.  Fix
      REL loads to match RELA stores.
      3f307074
    • H.J. Lu's avatar
      Don't set sh_size for .shstrtab twice · 946748d5
      H.J. Lu authored
      _bfd_elf_assign_file_positions_for_non_load will set the sh_size
      field for .shstrtab section.  There is need to initialize it in
      _bfd_elf_compute_section_file_positions.
      
      	* elf.c (_bfd_elf_compute_section_file_positions): Don't
      	initialize sh_size for .shstrtab here.
      946748d5
    • Simon Marchi's avatar
      py-prettyprint.exp: Add is_address_zero_readable check · bf7b9cd9
      Simon Marchi authored
      gdb/testsuite/ChangeLog:
      
      	* gdb.python/py-prettyprint.exp (run_lang_tests): Add
      	is_address_zero_readable check.
      bf7b9cd9
    • H.J. Lu's avatar
      Run ld-elf/strtab only on linux/gnu targets · 06e78fc7
      H.J. Lu authored
      Since not all ELF targets support -shared, we limit ld-elf/strtab to
      linux and gnu targets.
      
      	* ld-elf/strtab.d: Only run on *-*-linux* and *-*-gnu* targets.
      06e78fc7
    • H.J. Lu's avatar
      Update .strtab section sizes in mmix tests · 4a677ba7
      H.J. Lu authored
      Since commit ef10c3ac may reduce .strtab
      section size, we need to adjust expected .strtab section sizes in mmix
      tests.
      
      gas/testsuite/
      
      	* gas/mmix/loc-3.d: Updated.
      	* gas/mmix/loc-5.d: Likewise.
      
      ld/testsuite/
      
      	* ld-mmix/bspec1.d: Updated.
      	* ld-mmix/bspec2.d: Likewise.
      	* ld-mmix/undef-3.d: Likewise.
      4a677ba7
    • H.J. Lu's avatar
      Use strtab with GC and suffix merging for .strtab · ef10c3ac
      H.J. Lu authored
      This patch uses ELF strtab with GC and suffix merging support to create
      ELF .strtab section.  There is some small memory overhead to use ELF
      strtab:
      
      ==14928== HEAP SUMMARY:
      ==14928==     in use at exit: 3,276,318 bytes in 679 blocks
      ==14928==   total heap usage: 1,544 allocs, 865 frees, 15,259,146 bytes allocated
      
      vs.
      
      ==14936== HEAP SUMMARY:
      ==14936==     in use at exit: 3,276,318 bytes in 679 blocks
      ==14936==   total heap usage: 1,532 allocs, 853 frees, 15,026,402 bytes allocated
      
      when running:
      
      ./ld-new -m elf_x86_64 -o tmpdir/ld-partial.o -r ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf_x86_64.o eelf32_x86_64.o eelf_i386.o eelf_iamcu.o ei386linux.o eelf_l1om.o eelf_k1om.o ldbuildid.o
      
      The results are
      
        [32] .strtab STRTAB 0+ 3beff8 00407a 00 0 0 1
      
      vs
      
        [32] .strtab STRTAB 0+ 3beff8 0041d8 00 0 0 1
      
      It reduces the .strtab size by 350 bytes, about 2%
      
      Saving on libc.so from glibc is much more since libc.so has many alias
      symbols with the same suffix.  For x32 glibc,
      
       [82] .strtab STRTAB 0+ 81b348 0159e7 00 0 0 1
      
      vs
      
       [82] .strtab STRTAB 0+ 81b8bc 019e72 00 0 0 1
      
      It reduces the .strtab size by 17547 bytes, about 16%.
      
      bfd/
      
      	PR gas/18451
      	* elf-bfd.h (elf_sym_strtab): New.
      	(elf_link_hash_table): Add strtabcount, strtabsize and
      	strtab.
      	(_bfd_elf_stringtab_init): Removed.
      	* elf.c (_bfd_elf_stringtab_init): Removed.
      	(_bfd_elf_compute_section_file_positions): Replace
      	bfd_strtab_hash/_bfd_elf_stringtab_init/_bfd_stringtab_free/
      	_bfd_stringtab_size with
      	elf_strtab_hash/_bfd_elf_strtab_init/_bfd_elf_strtab_free/
      	_bfd_elf_strtab_size.  Use _bfd_elf_strtab_add,
      	_bfd_elf_strtab_finalize and _bfd_elf_strtab_offset to get
      	st_name.
      	(swap_out_syms): Likewise.
      	* elflink.c (elf_final_link_info): Replace bfd_strtab_hash
      	with elf_strtab_hash.  Remove symbuf, symbuf_count,
      	symbuf_size and shndxbuf_size.
      	(elf_link_flush_output_syms): Removed.
      	(elf_link_output_sym): Renamed to ...
      	(elf_link_output_symstrtab): This.  Replace _bfd_stringtab_add
      	with _bfd_elf_strtab_add.  Don't flush symbols to the file nor
      	swap out symbols.
      	(elf_link_swap_symbols_out): New.
      	(elf_link_output_extsym): Replace elf_link_output_sym with
      	elf_link_output_symstrtab.
      	(elf_link_input_bfd): Likewise.
      	(elf_final_link_free): Replace _bfd_stringtab_free with
      	_bfd_elf_strtab_free.  Remove symbuf.
      	(bfd_elf_final_link): Replace _bfd_elf_stringtab_init with
      	_bfd_elf_strtab_init.  Don't set symbuf, symbuf_count,
      	symbuf_size nor shndxbuf_size.  Initialize strtabsize and
      	strtab.  Initialize symshndxbuf to -1 when number of sections
      	>= 64K.  Replace elf_link_output_sym/elf_link_output_sym with
      	elf_link_output_symstrtab/elf_link_output_symstrtab. Don't
      	call elf_link_flush_output_syms.  Call _bfd_elf_strtab_finalize
      	and elf_link_swap_symbols_out.  Replace _bfd_stringtab_size
      	and _bfd_stringtab_emit with _bfd_elf_strtab_size and
      	_bfd_elf_strtab_emit.
      
      gas/testsuite/
      
      	PR gas/18451
      	* gas/elf/elf.exp: Run strtab.
      	* gas/elf/strtab.d: New file.
      	* gas/elf/strtab.s: Likewise.
      
      ld/testsuite/
      
      	PR gas/18451
      	* ld-elf/strtab.d: New file.
      	* ld-elf/strtab.s: Likewise.
      ef10c3ac
    • Gary Benson's avatar
      Correctly notice empty sysroots in solib_find_1 · f8773be1
      Gary Benson authored
      Some parts of solib_find_1 should only operate if the sysroot
      is nonempty after processing, but the logic that checked this
      happened before trailing slashes were stripped so empty but
      non-NULL sysroots were possible.  This commit moves the logic
      so it correctly notices all empty sysroots.
      
      gdb/ChangeLog:
      
      	* solib.c (solib_find_1): Set local variable sysroot to NULL if
      	it is the empty string after trailing slashes have been stripped.
      f8773be1
    • Gary Benson's avatar
      Remove gdb_sysroot NULL checks · a3be80c3
      Gary Benson authored
      Since fed040c6 gdb_sysroot is
      never NULL.  This commit removes all gdb_sysroot NULL checks.
      
      gdb/ChangeLog:
      
      	* exec.c (exec_file_locate_attach): Remove gdb_sysroot NULL check.
      	* infrun.c (follow_exec): Likewise.
      	* remote.c (remote_filesystem_is_local): Likewise.
      	* solib.c (solib_find_1): Likewise.
      a3be80c3
    • GDB Administrator's avatar
      Automatic date update in version.in · 53f7371c
      GDB Administrator authored
      53f7371c