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

  1. 10 Oct, 2014 3 commits
  2. 23 Sep, 2014 3 commits
    • H.J. Lu's avatar
      Disallow VEX/EVEX encoded instructions in 16-bit mode · 9e5e5283
      H.J. Lu authored
      gas/
      
      	PR gas/17421
      	* config/tc-i386.c (md_assemble): Disallow VEX/EVEX encoded
      	instructions in 16-bit mode.
      
      gas/testsuite/
      
      	PR gas/17421
      	* gas/i386/i386.exp: Run inval-16.
      
      	* gas/i386/inval-16.l: New file.
      	* gas/i386/inval-16.s: Likewise.
      9e5e5283
    • Yao Qi's avatar
      Honour SIGILL and SIGSEGV in cancel breakpoint and event lwp selection · c4d9ceb6
      Yao Qi authored
      I see the following fail on arm-none-linux-gnueabi testing,
      
      (gdb) continue^M
      Continuing.^M
      ^M
      Program received signal SIGILL, Illegal instruction.^M
      [Switching to Thread 1003]^M
      handler (signo=10) at
      /scratch/yqi/arm-none-linux-gnueabi/src/gdb-trunk/gdb/testsuite/gdb.threads/sigstep-threads.c:33^M
      33        tgkill (getpid (), gettid (), SIGUSR1);       /* step-2 */^M
      (gdb) FAIL: gdb.threads/sigstep-threads.exp: continue
      
      the cause is that GDBserver doesn't cancel the breakpoint if the stop
      signal is SIGILL.  The kernel used here is a little old, 2.6.x, and
      doesn't translate SIGILL to SIGTRAP when program hits breakpoint
      instruction (which is an illegal instruction actually).  GDB and
      GDBserver can translate SIGILL to SIGTRAP under certain circumstance,
      so it is not a problem here.  See gdbserver/linux-low.c:linux_wait_1
      
        /* If this event was not handled before, and is not a SIGTRAP, we
           report it.  SIGILL and SIGSEGV are also treated as traps in case
           a breakpoint is inserted at the current PC.  If this target does
           not support internal breakpoints at all, we also report the
           SIGTRAP without further processing; it's of no concern to us.  */
        maybe_internal_trap
          = (supports_breakpoints ()
             && (WSTOPSIG (w) == SIGTRAP
      	   || ((WSTOPSIG (w) == SIGILL
      		|| WSTOPSIG (w) == SIGSEGV)
      	       && (*the_low_target.breakpoint_at) (event_child->stop_pc))));
      
      However, SIGILL and SIGSEGV is not considered when cancelling
      breakpoint, which causes the fail above.  That is, when GDB is doing
      software single step on address ADDR, both thread A and thread B hits the
      software single step breakpoint, and get SIGILL.  GDB selects the event
      from thread A, removes the software single step breakpoint, and resume
      the program.  The event (SIGILL) from thread B is reported to GDB, but
      GDB doesn't regard this SIGILL as SIGTRAP, because the breakpoint on
      address ADDR was removed, so GDB reports "Program received signal
      SIGILL".
      
      The patch is to allow calling cancel_breakpoint if the signal is
      SIGILL and SIGSEGV.  This patch fixes the fail above.  Likewise, event
      lwp selection should honour SIGILL and SIGSEGV too.
      
      gdb/gdbserver:
      
      2014-09-23  Yao Qi  <yao@codesourcery.com>
      
      	* linux-low.c (lp_status_maybe_breakpoint): New function.
      	(linux_low_filter_event): Call lp_status_maybe_breakpoint.
      	(count_events_callback): Likewise.
      	(select_event_lwp_callback): Likewise.
      	(cancel_breakpoints_callback): Likewise.
      c4d9ceb6
    • Alan Modra's avatar
      daily update · 302717cc
      Alan Modra authored
      302717cc
  3. 22 Sep, 2014 16 commits
    • Sterling Augustine's avatar
      Fix 'call8: call target out of range' xtensa ld relaxation bug · 331ed130
      Sterling Augustine authored
      During link-time relaxation distance between cross-section call site and
      its target may grow, producing 'call target out of range' error for
      relaxed calls. Be more conservative when calculating whether or not a
      callx can be converted to a straight call.
      
      2014-09-23  Sterling Augustine  <augustine.sterling@gmail.com>
      
      bfd/
          * elf32-xtensa.c (is_resolvable_asm_expansion): for cross-section
          call relaxation use furthermost addresses where call source and
          destination can be to check whether it's in the range of a direct
          call.
      331ed130
    • H.J. Lu's avatar
      Ignore MOD field for control/debug register move · 68f34464
      H.J. Lu authored
      This patch ignores the MOD field in control/debug register move
      instructions.
      
      gas/testsuite/
      
      	* gas/i386/cdr.d: New file.
      	* gas/i386/cdr.s: Likewise.
      	* gas/i386/x86-64-cdr.d: Likewise.
      
      	* gas/i386/i386.exp: Run cdr and x86-64-cdr.
      
      opcodes/
      
      	* i386-dis.c (MOD_0F20): Removed.
      	(MOD_0F21): Likewise.
      	(MOD_0F22): Likewise.
      	(MOD_0F23): Likewise.
      	(dis386_twobyte): Replace MOD_0F20, MOD_0F21, MOD_0F22 and
      	MOD_0F23 with "movZ".
      	(mod_table): Remove MOD_0F20, MOD_0F21, MOD_0F22 and MOD_0F23.
      	(OP_R): Check mod/rm byte and call OP_E_register.
      68f34464
    • Chen Gang's avatar
      readline/search.c: Remove useless parameter '0' for rl_message() · 20b23ee6
      Chen Gang authored
      The related warning under Darwin x86_64:
      
        gcc -c -DHAVE_CONFIG_H    -I. -I../../binutils-gdb/readline -DRL_LIBRARY_VERSION='"6.2"' -g -O2 ../../binutils-gdb/readline/search.c
        ../../binutils-gdb/readline/search.c:213:24: warning: data argument not used by format string [-Wformat-extra-args]
          rl_message ("%s", p, 0);
                      ~~~~     ^
        1 warning generated.
      
      readline/ChangeLog.gdb:
      
      	* search.c (_rl_nsearch_init): Remove useless parameter '0' for
      	rl_message().
      Signed-off-by: default avatarChen Gang <gang.chen.5i5j@gmail.com>
      20b23ee6
    • Jan-Benedict Glaw's avatar
      2014-09-22 Jan-Benedict Glaw <jbglaw@lug-owl.de> · 342cc091
      Jan-Benedict Glaw authored
      	* gdb.texinfo (Set Breaks): Add missing "@end table".
      342cc091
    • Gary Benson's avatar
      Update target_stop's documentation · 9a6cf368
      Gary Benson authored
      This commit updates target_stop's documentation to clarify that
      it is asynchronous.
      
      gdb/ChangeLog:
      
      	* target.c (target_stop): Updated comment.
      9a6cf368
    • Gary Benson's avatar
      Rename target_{stop,continue}_ptid · 03f4463b
      Gary Benson authored
      This commit renames target_stop_ptid as target_stop_and_wait and
      target_continue_ptid as target_continue_no_signal.  Comments are
      updated to more fully describe the functions' behaviour.
      
      gdb/ChangeLog:
      
      	* target/target.h (target_stop_ptid): Renamed as...
      	(target_stop_and_wait): New function.  Updated comment.
      	All uses updated.
      	(target_continue_ptid): Renamed as...
      	(target_continue_no_signal): New function.  Updated comment.
      	All uses updated.
      03f4463b
    • Alan Modra's avatar
      Find lto plugin when using gcc-5.0 · 4dea914e
      Alan Modra authored
      I originally had this as --print-prog-name and changed back to
      --print-file-name to suit older gcc, neglecting to check whether
      gcc-5.0 --print-file-name finds the lto plugin.  It doesn't.
      
      	* ld-plugin/lto.exp: Use both --print-file-name and --print-prog-name
      	when looking for lto plugin.
      4dea914e
    • Alan Modra's avatar
      Fix various warnings seen when using gcc-5.0 · 28a0da39
      Alan Modra authored
      	* config/tc-m68k.c (md_assemble): Add assert to work around
      	bogus trunk gcc warning.
      	* config/tc-pj.h (md_convert_frag): Warning fix.
      	* config/tc-xtensa.c (xg_assemble_vliw_tokens): Warning fix.
      28a0da39
    • Alan Modra's avatar
      Readelf: Handle forward references to CIEs · 49727e46
      Alan Modra authored
      The linker side of pr16563 was fixed with commit 18cd5bce, but
      unfortunately people continue to use older linkers with -flto.  This
      means we have binaries with working .eh_frame that can't be dumped by
      readelf, and I'm seeing internal IBM bug reports about this fact.
      
      	PR 16563
      	* dwarf.c (GET): Remove semicolon.
      	(read_cie): New function, extracted from..
      	(display_debug_frames): ..here.  Correctly handle signed offset
      	from FDE to CIE in .eh_frame.  Decode forward referenced CIEs too.
      49727e46
    • Alan Modra's avatar
      Produce output file with -noinhibit-exec after overlapping FDE error · aa8f4d1e
      Alan Modra authored
      	* elf-eh-frame (_bfd_elf_write_section_eh_frame_hdr): Don't return
      	false for overflow or overlapping FDEs.  Give more detail in
      	error messages.
      aa8f4d1e
    • Pedro Alves's avatar
      Fix "breakpoint always-inserted off"; remove "breakpoint always-inserted auto" · a25a5a45
      Pedro Alves authored
      By default, GDB removes all breakpoints from the target when the
      target stops and the prompt is given back to the user.  This is useful
      in case GDB crashes while the user is interacting, as otherwise,
      there's a higher chance breakpoints would be left planted on the
      target.
      
      But, as long as any thread is running free, we need to make sure to
      keep breakpoints inserted, lest a thread misses a breakpoint.  With
      that in mind, in preparation for non-stop mode, we added a "breakpoint
      always-inserted on" mode.  This traded off the extra crash protection
      for never having threads miss breakpoints, and in addition is more
      efficient if there's a ton of breakpoints to remove/insert at each
      user command (e.g., at each "step").
      
      When we added non-stop mode, and for a period, we required users to
      manually set "always-inserted on" when they enabled non-stop mode, as
      otherwise GDB removes all breakpoints from the target as soon as any
      thread stops, which means the other threads still running will miss
      breakpoints.  The test added by this patch exercises this.
      
      That soon revealed a nuisance, and so later we added an extra
      "breakpoint always-inserted auto" mode, that made GDB behave like
      "always-inserted on" when non-stop was enabled, and "always-inserted
      off" when non-stop was disabled.  "auto" was made the default at the
      same time.
      
      In hindsight, this "auto" setting was unnecessary, and not the ideal
      solution.  Non-stop mode does depends on breakpoints always-inserted
      mode, but only as long as any thread is running.  If no thread is
      running, no breakpoint can be missed.  The same is true for all-stop
      too.  E.g., if, in all-stop mode, and the user does:
      
       (gdb) c&
       (gdb) b foo
      
      That breakpoint at "foo" should be inserted immediately, but it
      currently isn't -- currently it'll end up inserted only if the target
      happens to trip on some event, and is re-resumed, e.g., an internal
      breakpoint triggers that doesn't cause a user-visible stop, and so we
      end up in keep_going calling insert_breakpoints.  The test added by
      this patch also covers this.
      
      IOW, no matter whether in non-stop or all-stop, if the target fully
      stops, we can remove breakpoints.  And no matter whether in all-stop
      or non-stop, if any thread is running in the target, then we need
      breakpoints to be immediately inserted.  And then, if the target has
      global breakpoints, we need to keep breakpoints even when the target
      is stopped.
      
      So with that in mind, and aiming at reducing all-stop vs non-stop
      differences for all-stop-on-stop-of-non-stop, this patch fixes
      "breakpoint always-inserted off" to not remove breakpoints from the
      target until it fully stops, and then removes the "auto" setting as
      unnecessary.  I propose removing it straight away rather than keeping
      it as an alias, unless someone complains they have scripts that need
      it and that can't adjust.
      
      Tested on x86_64 Fedora 20.
      
      gdb/
      2014-09-22  Pedro Alves  <palves@redhat.com>
      
      	* NEWS: Mention merge of "breakpoint always-inserted" modes "off"
      	and "auto" merged.
      	* breakpoint.c (enum ugll_insert_mode): New enum.
      	(always_inserted_mode): Now a plain boolean.
      	(show_always_inserted_mode): No longer handle AUTO_BOOLEAN_AUTO.
      	(breakpoints_always_inserted_mode): Delete.
      	(breakpoints_should_be_inserted_now): New function.
      	(insert_breakpoints): Pass UGLL_INSERT to
      	update_global_location_list instead of calling
      	insert_breakpoint_locations manually.
      	(create_solib_event_breakpoint_1): New, factored out from ...
      	(create_solib_event_breakpoint): ... this.
      	(create_and_insert_solib_event_breakpoint): Use
      	create_solib_event_breakpoint_1 instead of calling
      	insert_breakpoint_locations manually.
      	(update_global_location_list): Change parameter type from boolean
      	to enum ugll_insert_mode.  All callers adjusted.  Adjust to use
      	breakpoints_should_be_inserted_now and handle UGLL_INSERT.
      	(update_global_location_list_nothrow): Change parameter type from
      	boolean to enum ugll_insert_mode.
      	(_initialize_breakpoint): "breakpoint always-inserted" option is
      	now a boolean command.  Update help text.
      	* breakpoint.h (breakpoints_always_inserted_mode): Delete declaration.
      	(breakpoints_should_be_inserted_now): New declaration.
      	* infrun.c (handle_inferior_event) <TARGET_WAITKIND_LOADED>:
      	Remove breakpoints_always_inserted_mode check.
      	(normal_stop): Adjust to use breakpoints_should_be_inserted_now.
      	* remote.c (remote_start_remote): Likewise.
      
      gdb/doc/
      2014-09-22  Pedro Alves  <palves@redhat.com>
      
      	* gdb.texinfo (Set Breaks): Document that "set breakpoint
      	always-inserted off" is the default mode now.  Delete
      	documentation of "set breakpoint always-inserted auto".
      
      gdb/testsuite/
      2014-09-22  Pedro Alves  <palves@redhat.com>
      
      	* gdb.threads/break-while-running.exp: New file.
      	* gdb.threads/break-while-running.c: New file.
      a25a5a45
    • Pedro Alves's avatar
      Tell update_global_location_list to insert breakpoints · 04086b45
      Pedro Alves authored
      This adds a new mode for update_global_location_list, that allows
      callers saying "please insert breakpoints, even if
      breakpoints_always_inserted_mode() is false".  This allows removing a
      couple breakpoints_always_inserted_mode checks.
      
      gdb/
      2014-09-22  Pedro Alves  <palves@redhat.com>
      
      	* breakpoint.c (enum ugll_insert_mode): Add UGLL_INSERT.
      	(insert_breakpoints): Don't call insert_breakpoint_locations here.
      	Instead, pass UGLL_INSERT to update_global_location_list.
      	(update_global_location_list): Change parameter type from boolean
      	to enum ugll_insert_mode.  All callers adjusted.  Adjust to use
      	breakpoints_should_be_inserted_now and handle UGLL_INSERT.
      	(create_solib_event_breakpoint_1): New, factored out from ...
      	(create_solib_event_breakpoint): ... this.
      	(create_and_insert_solib_event_breakpoint): Use
      	create_solib_event_breakpoint_1 instead of calling
      	insert_breakpoint_locations manually.
      	(update_global_location_list): Handle UGLL_INSERT.
      04086b45
    • Pedro Alves's avatar
      Change parameter type of update_global_location_list from boolean to enum · 44702360
      Pedro Alves authored
      Later we'll want a tristate, but for now, convert to an enum that maps 1-1
      with the current boolean's true/false.
      
      gdb/
      2014-09-22  Pedro Alves  <palves@redhat.com>
      
      	* breakpoint.c (enum ugll_insert_mode): New enum.
      	(update_global_location_list)
      	(update_global_location_list_nothrow): Change parameter type from
      	boolean to enum ugll_insert_mode.  All callers adjusted.
      44702360
    • Matthew Fortune's avatar
      MIPS: Don't sign extend the addend for RELA relocations · c3eb94b4
      Matthew Fortune authored
      bfd/
      
      	* elfxx-mips.c (mips_elf_calculate_relocation): Don't sign extend
      	the addend if relocations are RELA.
      c3eb94b4
    • Kuan-Lin Chen's avatar
      NDS32/bfd: Synchronize the argument type. · f4cb41f4
      Kuan-Lin Chen authored
      f4cb41f4
    • Alan Modra's avatar
      daily update · bc212851
      Alan Modra authored
      bc212851
  4. 21 Sep, 2014 1 commit
  5. 20 Sep, 2014 1 commit
  6. 19 Sep, 2014 6 commits
    • Joel Brobecker's avatar
      Add Sergio Durigan Junior as maintainer of SystemTap support in GDB. · 93c6145a
      Joel Brobecker authored
      gdb/ChangeLog:
      
      	* MAINTAINERS: Add Sergio Durigan Junior as maintainer of
      	SystemTap support in GDB.
      93c6145a
    • Don Breazeal's avatar
      Refactor ptrace extended event status. · 89a5711c
      Don Breazeal authored
      This commit implements functions for identifying and extracting extended
      ptrace event information from a Linux wait status.  These are just
      convenience functions intended to hide the ">> 16" used to extract the
      event from the wait status word, replacing the hard-coded shift with a more
      descriptive function call.  This is preparatory work for implementation of
      follow-fork and detach-on-fork for extended-remote linux targets.
      
      gdb/ChangeLog:
      
      	* linux-nat.c (linux_handle_extended_wait): Call
      	linux_ptrace_get_extended_event.
      	(wait_lwp): Call linux_is_extended_waitstatus.
      	(linux_nat_filter_event): Call linux_ptrace_get_extended_event
      	and linux_is_extended_waitstatus.
      	* nat/linux-ptrace.c (linux_test_for_tracefork): Call
      	linux_ptrace_get_extended_event.
      	(linux_ptrace_get_extended_event): New function.
      	(linux_is_extended_waitstatus): New function.
      	* nat/linux-ptrace.h (linux_ptrace_get_extended_event)
      	(linux_is_extended_waitstatus): New declarations.
      
      gdb/gdbserver/ChangeLog:
      
      	* linux-low.c (handle_extended_wait): Call
      	linux_ptrace_get_extended_event.
      	(get_stop_pc, get_detach_signal, linux_low_filter_event): Call
      	linux_is_extended_waitstatus.
      
      ---
      89a5711c
    • Andreas Krebbel's avatar
      S/390: Don't replace R_390_TLS_LE32/64 with R_390_TLS_TPOFF for PIE. · e00d879a
      Andreas Krebbel authored
      bfd:
      
      2014-09-19  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
      
      	* elf32-s390.c: Don't replace R_390_TLS_LE32 with R_390_TLS_TPOFF
      	for PIE.
      	* elf64-s390.c: Don't replace R_390_TLS_LE64 with R_390_TLS_TPOFF
      	for PIE.
      e00d879a
    • Yao Qi's avatar
      Run dw2-var-zero-addr.exp with --readnow · 00ba3162
      Yao Qi authored
      This patch is to extend dw2-var-zero-add.exp to cover the case that
      partial symtabl is not used while full symtab is used, in order to
      cover the changes in patch 2/3.  This patch restarts GDB with
      --readnow and does the same test again.
      
      gdb/testsuite:
      
      2014-09-19  Yao Qi  <yao@codesourcery.com>
      
      	* gdb.dwarf2/dw2-var-zero-addr.exp: Move test into new proc test.
      	Invoke test.  Restart GDB with --readnow and invoke test again.
      00ba3162
    • Yao Qi's avatar
      Check function is GC'ed · c3b7b696
      Yao Qi authored
      I see the following fail on arm-none-eabi target,
      
      (gdb) b 24^M
      Breakpoint 1 at 0x4: file
      ../../../../git/gdb/testsuite/gdb.base/break-on-linker-gcd-function.cc,
      line 24.^M
      (gdb) FAIL: gdb.base/break-on-linker-gcd-function.exp: b 24
      
      Currently, we are using flag has_section_at_zero to determine whether
      address zero in debug info means the corresponding code has been
      GC'ed, like this:
      
      	case DW_LNE_set_address:
      	  address = read_address (abfd, line_ptr, cu, &bytes_read);
      
      	  if (address == 0 && !dwarf2_per_objfile->has_section_at_zero)
      	    {
      	      /* This line table is for a function which has been
      		 GCd by the linker.  Ignore it.  PR gdb/12528 */
      
      However, this is incorrect on some bare metal targets, as .text
      section is located at 0x0, so dwarf2_per_objfile->has_section_at_zero
      is true.  If a function is GC'ed by linker, the address is zero.  GDB
      thinks address zero is a function's address rather than this function
      is GC'ed.
      
      In this patch, we choose 'lowpc' got in read_file_scope to check
      whether 'lowpc' is greater than zero.  If it isn't, address zero really
      means the function is GC'ed.  In this patch, we pass 'lowpc' in
      read_file_scope through handle_DW_AT_stmt_list and dwarf_decode_lines,
      and to dwarf_decode_lines_1 finally.
      
      This patch fixes the fail above. This patch also covers the path that
      partial symbol isn't used, which is tested by starting gdb with
      --readnow option.
      
      It is regression tested on x86-linux with
      target_board=dwarf4-gdb-index, and arm-none-eabi.  OK to apply?
      
      gdb:
      
      2014-09-19  Yao Qi  <yao@codesourcery.com>
      
      	* dwarf2read.c (dwarf_decode_lines): Update declaration.
      	(handle_DW_AT_stmt_list): Add argument 'lowpc'.  Update
      	comments.  Callers update.
      	(dwarf_decode_lines): Likewise.
      	(dwarf_decode_lines_1): Add argument 'lowpc'.  Update
      	comments.  Skip the line table if  'lowpc' is greater than
      	'address'.  Don't check
      	dwarf2_per_objfile->has_section_at_zero.
      
      gdb/testsuite:
      
      2014-09-19  Yao Qi  <yao@codesourcery.com>
      
      	* gdb.base/break-on-linker-gcd-function.exp: Move test into new
      	proc set_breakpoint_on_gcd_function.  Invoke
      	set_breakpoint_on_gcd_function.  Restart GDB with --readnow and
      	invoke set_breakpoint_on_gcd_function again.
      c3b7b696
    • Alan Modra's avatar
      daily update · 8e635c20
      Alan Modra authored
      8e635c20
  7. 18 Sep, 2014 4 commits
    • Rafael Ávila de Espíndola's avatar
      A a testcase for common symbol handling with plugins. · c0c71592
      Rafael Ávila de Espíndola authored
      2014-09-18  Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
      
      	* testsuite/Makefile.am (plugin_test_10): New test.
      	* testsuite/Makefile.in: Regenerate
      	* testsuite/plugin_common_test_2.c (c1): Align to 8.
      	* testsuite/plugin_test_10.sh: New file.
      c0c71592
    • Doug Evans's avatar
      New "producer" attribute of python gdb.Symtab. · 2b4fd423
      Doug Evans authored
      gdb/ChangeLog:
      
      	* NEWS: Mention new "producer" attribute of gdb.Symtab.
      	* python/py-symtab.c (stpy_get_producer): New function.
      	(symtab_object_getset): Add "producer" attribute.
      
      gdb/doc/ChangeLog:
      
      	* python.texi (Symbol Tables In Python): Document "producer"
      	attribute of gdb.Symtab objects.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.dwarf2/symtab-producer.exp: New file.
      2b4fd423
    • Jan Kratochvil's avatar
      Fix regression for Linux vDSO in GDB (PR gdb/17407). · 92c9bcd4
      Jan Kratochvil authored
      since
      	5979d6b6
      	https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=5979d6b69b20a8355ea94b75fad97415fce4788c
      	vdso handling
      	https://sourceware.org/ml/binutils/2014-03/msg00082.html
      	https://sourceware.org/ml/binutils/2014-04/msg00003.html
      	Message-ID: <A78C989F6D9628469189715575E55B230AA884EB@IRSMSX104.ger.corp.intel.com>
      I get on
      	kernel-3.16.2-200.fc20.x86_64
      	https://koji.fedoraproject.org/koji/buildinfo?buildID=575860
      	attaching its vdso.bin.gz
      GDB (FSF HEAD 5e43d467) regression:
      reproducer:
      	./gdb -ex start ./gdb
      actual result / FAIL:
      	Got object file from memory but can't read symbols: File truncated.
      expected result / PASS:
      	<nothing>
      or / PASS:
      	warning: Could not load shared library symbols for linux-vdso.so.1.
      	Do you need "set solib-search-path" or "set sysroot"?
      
      That "warning: Could not load shared library..." is mostly harmless (it is
      a bug in GDB), in the FAIL case it is not printed just because
      bfd_check_format() fails there.
      
      It seems logical to me this way when the 'size' parameter has been already
      added.
      Alan Modra:
      I was wrongly thinking that the section headers were
      always last when I wrote that code.  (They are now!  If you relink
      that vdso with current binutils master you won't hit this problem, but
      that of course doesn't help existing kernels.)
      
      I do not see a regression for add-symbol-file-from-memory for libncurses.so.5
      from the original thread above.
      
        Start of section headers:          1080 (bytes into file)
        Size of section headers:           64 (bytes)
        Number of section headers:         13
        Section header string table index: 8
      Section Headers:
        [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
        [ 8] .fake_shstrtab    STRTAB          0000000000000780 000780 000076 00   A  0   0 32
      Program Headers:
        Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
        LOAD           0x000000 0x0000000000000000 0x0000000000000000 0x0012fe 0x0012fe R E 0x1000
      
      size == 0x2000
      shdr_end == 0x778 == 1080 + 13 * 64
      high_offset == 0x12fe
      
             else if (size >= shdr_end)
      -	high_offset = shdr_end;
      +	high_offset = size;
      
      But then 0x778 < 0x780 for "Section header string table index" so whole
      bfd_check_format() fails because section headers were not cleared here:
        /* If the segments visible in memory didn't include the section headers,
           then clear them from the file header.  */
        if (high_offset < shdr_end)
      
      bfd/ChangeLog
      2014-09-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
      
      	PR gdb/17407
      	* elfcode.h (bfd_from_remote_memory): Use SIZE for HIGH_OFFSET.
      92c9bcd4
    • Alan Modra's avatar
      daily update · 039b3b7b
      Alan Modra authored
      039b3b7b
  8. 17 Sep, 2014 6 commits
    • Cary Coutant's avatar
      Regenerate gold/Makefile.in. · 6d610fa7
      Cary Coutant authored
      6d610fa7
    • Rafael Ávila de Espíndola's avatar
      Fix handling of common symbols with plugins. · 6168c2a1
      Rafael Ávila de Espíndola authored
      gold/ChangeLog:
      2014-09-17  Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
      
      	* plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
      	* resolve.cc (Symbol_table::resolve): Don't override common symbols
      	during the replacement phase.
      6168c2a1
    • Jing Yu's avatar
      Add tls support to gold aarch64 backend. · 3a531937
      Jing Yu authored
      elfcpp/ChangeLog:
      2014-09-17  Han Shen  <shenhan@google.com>
      	* aarch64.h (R_AARCH64_TLS_DTPREL64): Switch enum value with ...
      	(R_AARCH64_TLS_DTPMOD64): ... enum value.
      
      gold/ChangeLog:
      2014-09-17  Han Shen  <shenhan@google.com>
      	    Jing Yu  <jingyu@google.com>
              * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
              TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
              * aarch64.cc (Target_aarch64): Add data members
              got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
              tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
              constructor.
              (Target_aarch64::do_reloc_symbol_index): New method.
              (Target_aarch64::do_reloc_addend): New method.
              (Target_aarch64::add_tlsdesc_info): New method.
              (Target_aarch64::do_dynsym_value): New method.
              (Target_aarch64::do_make_data_plt): Add new parameters: got,
              got_irelative. Pass them to Output_data_plt_aarch64_standard.
              (Target_aarch64::make_data_plt): Add new parameters: got,
              got_irelative. Pass them to do_make_data_plt.
              (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
              (Target_aarch64::Relocate:tls_gd_to_le): New method.
              (Target_aarch64::Relocate:tls_ie_to_le): New method.
              (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
              (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
              (Target_aarch64::got_tlsdesc_section): New method.
              (Target_aarch64::make_local_ifunc_plt_entry): New method.
              (Target_aarch64::define_tls_base_symbol): New method.
              (Target_aarch64::reserve_tlsdesc_entries): New method.
              (Target_aarch64::got_mod_index_entry): New method.
              (Target_aarch64::rela_tlsdesc_section): New method.
              (Target_aarch64::rela_irelative_section): New method.
              (Target_aarch64::Tlsdesc_info): New struct.
              (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
              relocations and tlsdesc relocations.
              (Target_aarch64::optimize_tls_reloc): Implement method.
              (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
              got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
              in constructor.
              (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
              (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
              (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
              (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
              (Output_data_plt_aarch64::rela_tlsdesc): New method.
              (Output_data_plt_aarch64::rela_irelative): New method.
              (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
              (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
              (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
              (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
              (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
              (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
              (Output_data_plt_aarch64_standard): New member variables:
              plt_tlsdesc_entry_size, tlsdesc_plt_entry.
              (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
              New parameter: got, got_irelative.
              (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
              (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
              (Output_data_plt_aarch64::do_write): Replace got_address with
              gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
              (AArch64_relocate_functions::update_movnz): New method.
              (AArch64_relocate_functions): Correct format.
              (AArch64_relocate_functions::movnz): New method.
              (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
              before the switch. Add new cases to switch.
              Check ie_to_le relaxation on tlsie relocations. Add code handling
              tlsgd tlsdesc cases.
              (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
              needed. Add new cases to switch. Insert dynamic RELATIVE relocation
              when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
              Call reloc_name_in_error_message to print unsupported reloc.
              (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
              make_data_plt.
              (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
              relocs. Fill in some more dynamic tags.
              (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
              Skip call tls_get_addr when tlsgd is relaxed.
              (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
              handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
              tlsdesc->ie relaxation.
      3a531937
    • Ulrich Weigand's avatar
      PR gdb/17384: Do not print memory errors in safe_read_memory_integer · 5e43d467
      Ulrich Weigand authored
      If accessing memory via safe_read_memory_integer fails, that function
      used to print an error message even though callers were perfectly able
      to handle (and even expected!) failures.
      
      This patch removes the confusing message by changing the routine to
      directly use target_read_memory.
      
      gdb/ChangeLog:
      
      	PR gdb/17384
      	* corefile.c (struct captured_read_memory_integer_arguments): Remove.
      	(do_captured_read_memory_integer): Remove.
      	(safe_read_memory_integer): Use target_read_memory directly instead
      	of catching errors in do_captured_read_memory_integer.
      5e43d467
    • Tristan Gingold's avatar
      Fix arm-elf build failure on non-C99 systems (was using int64_t) · 2569ceb0
      Tristan Gingold authored
      gas/
              * config/tc-arm.c (move_or_literal_pool, add_to_lit_pool): Use
              bfd_int64_t instead of int64_t.
      2569ceb0
    • Sergio Durigan Junior's avatar
      Add test for global variable that is nested by another DSO · a5947601
      Sergio Durigan Junior authored
      This is just a testcase addition that I am proposing for upstream GDB.
      We have this in our internal tree, and the related RH bug is:
      
        <https://bugzilla.redhat.com/show_bug.cgi?id=809179>
      
      (You might not be able to see all the comments without privileges.)
      
      This bug is about a global variable that got incorrectly displayed by
      GDB.  This bug has already been fixed a long time ago by Joel's
      commit:
      
        commit 19630284
        Author: Joel Brobecker <brobecker@gnat.com>
        Date:   Tue Jun 5 13:50:50 2012 +0000
      
      But I think a testcase for it wouldn't hurt.
      
      So, consider the following scenario:
      
        $ cat solib1.c
        int test;
        void c_main (void)
        {
          test = 42;
        }
      
        $ cat solib2.c
        int test;
        void b_main (void)
        {
          test = 42;
        }
      
        $ cat main.c
        int main (int argc, char *argv[])
        {
          c_main ();
          b_main ();
          return 0;
        }
      
        $ gcc -g -fPIC -shared -o libSO1.so -c solib1.c
        $ gcc -g -fPIC -shared -o libSO2.so -c solib2.c
        $ gcc -g -o main -L$PWD -lSO1 -lSO2 main.c
        $ LD_LIBRARY_PATH=. gdb -q -batch -ex 'b c_main' -ex r -ex n -ex 'p test' ./main
        ...
        $1 = 0
      
      This happened with GDB before Joel's commit above.  Now, things work
      and GDB is able to correctly display the nested global variable:
      
        $ LD_LIBRARY_PATH=. gdb -q -batch -ex 'b c_main' -ex r -ex n -ex 'p test' ./main
        ...
        $1 = 42
      
      The testcase attached tests this behavior.
      
      gdb/testsuite/ChangeLog:
      2014-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>
      
      	* gdb.base/global-var-nested-by-dso-solib1.c: New file.
      	* gdb.base/global-var-nested-by-dso-solib2.c: Likewise.
      	* gdb.base/global-var-nested-by-dso.c: Likewise.
      	* gdb.base/global-var-nested-by-dso.exp: Likewise.
      a5947601