Bug 11786 - PIE support may not work for some PIEs
Summary: PIE support may not work for some PIEs
Status: UNCONFIRMED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: unknown
: P2 minor
Target Milestone: 7.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 16935
  Show dependency treegraph
 
Reported: 2010-07-02 17:14 UTC by Jan Kratochvil
Modified: 2024-01-14 14:36 UTC (History)
8 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2010-07-02 17:14:12 UTC
PIE support update going to be checked-in for gdb-7.2:
http://sourceware.org/ml/gdb-patches/2010-06/msg00231.html

assumes in svr4_exec_displacement just P_VADDR and P_PADDR get displaced.
prelink sources contains adjust_dso() which may in some cases relocated
also/only P_OFFSET, P_FILESZ and/or P_MEMSZ.

This would disable the PIE adjustment in GDB making it fail on such PIE
inferior.  I am currently not aware of such sample program.
Comment 1 dje 2013-09-05 20:41:29 UTC
Another variant that needs to be handled:
Gold sets PF_W for the GNU_RELRO segment and strip removes it.
This causes the following to fail:

bash$ gdb binary.unstripped core.from.stripped

svr4_exec_displacement thinks the core doesn't match the binary
(because of a program segment header mismatch in the flags field)
and the addresses from the core file are not applied.

I think it's reasonable to ignore the flags field for the purposes of this test,
but maybe I'm missing something.
Comment 2 Jan Kratochvil 2013-09-05 20:59:56 UTC
I just like the checks not to ignore unknown things so I would ignore just PF_W.

But I agree ignoring whole flags for GNU_RELRO would be also fine.  Ignoring flags everywhere I am not so sure.
Comment 3 dje 2013-09-05 21:37:28 UTC
For my own education (as I'm not familiar with all the ways this bit of code is used), suppose we ignore the flags field for all segments: what's the worst that could happen?
Comment 4 dje 2013-09-05 21:45:14 UTC
Gold also sets the alignment (p_align) of GNU_RELRO differently.

So maybe ignore p_flags, p_align for GNU_RELRO?
Comment 5 Jan Kratochvil 2013-09-06 07:10:14 UTC
(In reply to dje from comment #3)
> suppose we ignore the flags field for all segments: what's the
> worst that could happen?

If you use non-matching build of an executable it may get incorrectly relocated by some small displacement.  (*1)

People sometimes try to use non-matching build, IMO it cannot give meaningful output but it may make their attempts even more difficult when the executable gets "randomly" displaced.  Currently GDB does not display any notice it used PIE displacement (and there is also no longer any notice it used PIC displacement), unless one has "set verbose" (which nobody has).  This may make a falsely-matched displacement a pain.

(*1) Currently the displacement still has to be PAGE_SIZE aligned, if it is not PAGE_SIZE aligned no displacement gets used.  But I have TODOlisted I should recheck the PAGE_SIZE requirement as it was removed for shlibs by 2da7921acc5c7b327b3619a95ca7ca36a0314dc4 and IMO it should be equally removed for compatibility with prelinked/unprelinked PIE executables.
Comment 6 Jan Kratochvil 2013-09-06 07:13:02 UTC
(In reply to dje from comment #4)
> Gold also sets the alignment (p_align) of GNU_RELRO differently.

Differently than... bfd ld?  gold vs. ld executables are a different build which cannot match / is not guaranteed to match.  Therefore gold vs. ld executable should be found as differentl, therefore GNU_RELRO p_align _should_ be verified by svr4_exec_displacement.
Comment 7 Paul Pluzhnikov 2013-09-06 16:03:42 UTC
Would it be reasonable to check NT_GNU_BUILD_ID, and skip the Phdr check entirely on a match?

(In reply to Jan Kratochvil from comment #6)
> Differently than... bfd ld?  gold vs. ld executables are a different build
> which cannot match / is not guaranteed to match.

The flow here (Google b/10274851) is:

  (gold-linked, PIE) unstripped -> "strip -g" -> stripped -> core

  gdb stripped core    # works, but no debug info :-(
  gdb unstripped core  # fails to relocate the binary :-(

Gold and strip do not agree on p_flags and p_align of GNU_RELRO,
but the "unstripped" and "stripped" *are* exact match.
Comment 8 dje 2013-09-06 16:42:30 UTC
(In reply to Jan Kratochvil from comment #5)
> (In reply to dje from comment #3)
> > suppose we ignore the flags field for all segments: what's the
> > worst that could happen?
> 
> If you use non-matching build of an executable it may get incorrectly
> relocated by some small displacement.  (*1)
> 
> People sometimes try to use non-matching build, IMO it cannot give
> meaningful output but it may make their attempts even more difficult when
> the executable gets "randomly" displaced.  Currently GDB does not display
> any notice it used PIE displacement (and there is also no longer any notice
> it used PIC displacement), unless one has "set verbose" (which nobody has). 
> This may make a falsely-matched displacement a pain.
> 
> (*1) Currently the displacement still has to be PAGE_SIZE aligned, if it is
> not PAGE_SIZE aligned no displacement gets used.  But I have TODOlisted I
> should recheck the PAGE_SIZE requirement as it was removed for shlibs by
> 2da7921acc5c7b327b3619a95ca7ca36a0314dc4 and IMO it should be equally
> removed for compatibility with prelinked/unprelinked PIE executables.

If the addresses/displacements are different, sure.  One recognizes that going in.
But I asked about the flags field.

btw, 2da7921acc5c7b327b3619a95ca7ca36a0314dc4:  kinda meaningless without some reference to a repository.  For archeology's sake, IWBN to record that here.
Comment 9 Jan Kratochvil 2013-09-06 17:04:38 UTC
(In reply to Paul Pluzhnikov from comment #7)
> Would it be reasonable to check NT_GNU_BUILD_ID, and skip the Phdr check
> entirely on a match?

That is a great idea.  I have verified build-id computations checksum also the relevant parts of program headers and section headers.


> The flow here (Google b/10274851) is:
> 
>   (gold-linked, PIE) unstripped -> "strip -g" -> stripped -> core
> 
>   gdb stripped core    # works, but no debug info :-(
>   gdb unstripped core  # fails to relocate the binary :-(
> 
> Gold and strip do not agree on p_flags and p_align of GNU_RELRO,
> but the "unstripped" and "stripped" *are* exact match.

OK, that should be sure safe to ignore p_flags and p_align of GNU_RELRO.
(I am curious you do not use separate .debug file instead of unstripped file bat that is off-topic here.)


(In reply to dje from comment #8)
> btw, 2da7921acc5c7b327b3619a95ca7ca36a0314dc4:  kinda meaningless without
> some reference to a repository.  For archeology's sake, IWBN to record that
> here.

http://sourceware.org/git/?p=gdb.git - but (a) I am not sure if the new GDB GIT will not be on the same URL. (b) I believe we will need old hash -> new hash mapper anyway.
Comment 10 dje 2013-10-25 18:56:30 UTC
(In reply to Paul Pluzhnikov from comment #7)
> Would it be reasonable to check NT_GNU_BUILD_ID, and skip the Phdr check
> entirely on a match?
> 
> (In reply to Jan Kratochvil from comment #6)
> > Differently than... bfd ld?  gold vs. ld executables are a different build
> > which cannot match / is not guaranteed to match.
> 
> The flow here (Google b/10274851) is:
> 
>   (gold-linked, PIE) unstripped -> "strip -g" -> stripped -> core
> 
>   gdb stripped core    # works, but no debug info :-(
>   gdb unstripped core  # fails to relocate the binary :-(
> 
> Gold and strip do not agree on p_flags and p_align of GNU_RELRO,
> but the "unstripped" and "stripped" *are* exact match.

What if the core file doesn't have NT_GNU_BUILD_ID?
E.g., what if the program headers in the core file (obtained via auxv search, ref: gdb/solib-svr4.c:read_program_header) refer to addresses only in the executable?
Comment 11 dje 2013-11-04 22:15:58 UTC
From https://sourceware.org/ml/gdb-patches/2013-10/msg00935.html

CentOS-5 has additional problems: the filesz and memsz fields don't match b/w
stripped and non-stripped binaries.
Comment 12 Sourceware Commits 2013-11-08 00:45:23 UTC
       via  204b53315d81361b008036d93c355ab1f2a44997 (commit)
      from  459d52c84aa5eee986006b793794e382861c073d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=204b53315d81361b008036d93c355ab1f2a44997

commit 204b53315d81361b008036d93c355ab1f2a44997
Author: Doug Evans <dje@google.com>
Date:   Thu Nov 7 16:43:39 2013 -0800

    PR 11786
    *  solib-svr4.c (svr4_exec_displacement): Ignore filesz, memsz, flags
    and align fields for PT_GNU_RELRO segments.
    
    testsuite/
    * gdb.base/gcore-relro-pie.c: New file.
    * gdb.base/gcore-relro-pie.exp: New file.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                              |    6 ++
 gdb/solib-svr4.c                           |   44 ++++++++++++++++
 gdb/testsuite/ChangeLog                    |    6 ++
 gdb/testsuite/gdb.base/gcore-relro-pie.c   |   41 +++++++++++++++
 gdb/testsuite/gdb.base/gcore-relro-pie.exp |   75 ++++++++++++++++++++++++++++
 5 files changed, 172 insertions(+), 0 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/gcore-relro-pie.c
 create mode 100644 gdb/testsuite/gdb.base/gcore-relro-pie.exp
Comment 13 Sourceware Commits 2013-12-13 16:52:48 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The annotated tag, hjl/linux/release/2.24.51.0.2 has been created
        at  bc64dc5b95aa848d7274e4648d667b9b1065d88c (tag)
   tagging  bbd7f545f1639be4573ba06ed688b8db670d4597 (commit)
  replaces  hjl/linux/release/2.24.51.0.1
 tagged by  H.J. Lu
        on  Fri Dec 13 08:44:03 2013 -0800

- Log -----------------------------------------------------------------
Linux binutils 2.24.51.0.2

Alan Modra (47):
      daily update
      daily update
      daily update
      daily update
      daily update
      Correct elf64-ppc.c handling of protected symbols
      PowerPC64 ELFv2, allocate dynreloc space for ifunc
      daily update
      daily update
      daily update
      daily update
      PowerPC64 ELFv2 trampoline match
      Fixes to powerpc64 gold ELFv2 support
      Add missing ChangeLog for 88b8e63904fda25c029deaf25d7b4e489b351470
      daily update
      daily update
      daily update
      daily update
      daily update
      daily update
      daily update
      Import config.sub and config.guess from upstream.
      daily update
      daily update
      daily update
      daily update
      daily update
      daily update
      daily update
      daily update
      daily update
      daily update
      daily update
      PowerPC64 linking of --just-symbols objects (klibc)
      More PowerPC64 ELFv2 --just-symbols fixes
      daily update
      daily update
      daily update
      daily update
      daily update
      Fix --as-needed undefined symbol references from dynamic libraries.
      correct file reference
      daily update
      daily update
      daily update
      daily update
      daily update

Alexey Makhalov (1):
      PR gas/16109

Andreas Arnez (3):
      S390: Fix TDB regset recognition
      Fix GDB crash with upstream GCC due to qsort(NULL, ...)
      Fix GDB crash with upstream GCC due to memcpy(NULL, ...)

Andrew Burgess (6):
      Mark entirely optimized out value as non-lazy.
      Tighten regexp in gdb.base/setshow.exp
      Make "set debug frame 1" use the standard print routine for optimized out values.
      Print entirely unavailable struct/union values as a single <unavailable>.
      Add support for DW_OP_bit_piece and DW_OP_plus_uconst to DWARF assembler.
      Add call to get_compiler_info to gdb_compile_shlib.

Andrew Pinski (2):
      ld/ChangeLog:
      ld/ChangeLog:

Anthony Green (1):
      Add software single step support to moxie port

Cary Coutant (6):
      Fix assert failure with --emit-relocs and .eh_frame sections.
      Fix race condition while building EH frame header.
      Add --verify-only option to DWP.
      Revert "Fix race condition while building EH frame header."
      Use in-tree assembler for exception_x86_64_bnd_test.
      Add check for which library is needed for dlopen.

Catherine Moore (4):
      2013-11-11  Catherine Moore  <clm@codesourcery.com>
      Fix ChangeLog entries from earlier commit.
      2013-11-19  Catherine Moore  <clm@codesourcery.com>
      2013-11-19  Catherine Moore  <clm@codesourcery.com>

Chung-Lin Tang (1):
      Separate emulations for nios2-elf and nios2-linux.

Conrad Hoffmann (1):
      * gprof.c (inline_file_names): New variable.

Cory Fields (1):
      * windres.c (define_resource): Use zero for timestamp, making

Doug Evans (42):
      * gdb.python/py-arch.exp: Tweak test name for bad memory access test.
      Add pretty-printing of .debug_gnu_pubnames, .debug_gnu_pubtypes.
      PR 11786
      Fix email address in earlier entry.
      Change "set debug symtab-create" to take a verbosity level.
      Change "set debug dwarf2-read" to take a verbosity level.
      * gdb.arch/arm-bl-branch-dest.exp: Use gdb_test_file_name instead
      Work around gold/15646.
      * gdb.base/fileio.exp: Make $dir2 writable after the test is done
      * breakpoint.c (bpstat_check_breakpoint_conditions): Assert
      fix email address in earlier commit
      * breakpoint.c (breakpoint_cond_eval): Fix and enhance comment.
      * breakpoint.c (bpstat_check_breakpoint_conditions): For thread
      * gdb.python/py-breakpoint.exp: Split up into several functions,
      * gdb.python/py-breakpoint.exp: Reformat for 80 columns.
      * gdb.python/py-breakpoint.exp: Make tests have unique names.
      * linux-low.c (resume_status_pending_p): Tweak comment.
      * linux-low.c (linux_set_resume_request): Fix comment.
      Move types_deeply_equal from py-type.c to gdbtypes.c.
      cli/cli-script.c (multi_line_command_p): New function.
      * python/py-frame.c (frapy_block): Fix error message text.
      * python/py-frame.c (gdbpy_initialize_frames): Remove FIRST_ERROR,
      * gdb.python/python.exp: Don't call skip_python_tests, we still want
      Fix long line in earlier entry.
      * gdb.python/py-symbol.exp: Fix whitespace.
      * gdb.python/py-symbol.exp: Add some comments.  Make all test names unique.
      * gdb.python/py-type.exp (test_enums): Fix typo.
      Test name tweaks for py-value.exp.
      * gdb.base/ena-dis-br.exp: Add missing quote to "step after continue
      * configure.ac: Add comments delineating libpython and libmcheck.
      fix spelling in previous entry
      Rename breakpoint_object to gdbpy_breakpoint_object.
      Remove trailing whitespace.
      * python/py-auto-load.c (source_section_scripts): Move comment to
      Move .debug_gdb_script processing to auto-load.c.
      * auto-load.c (load_auto_scripts_for_objfile): Add some comments.
      fix date in previous entry
      * gdb.base/break.exp: Fix setting of $baz.
      Delete interp_exec_p.
      PR 16286
      add missing PR# to previous entry
      * dwarf2read.c (lookup_dwo_cutu): Include name of dwp file in

Edjunior Barbosa Machado (1):
      Fix argument type on gdbsim_detach prototype.

Eli Zaretskii (2):
      doc/gdb.texinfo (i386): Fix yesterday's commit.
      Fix the manual more thoroughly.

H.J. Lu (45):
      Add binutils-sharable.patch
      Add binutils-lto-mixed.patch
      Add binutils-pr12639.patch
      Add binutils-secondary.patch
      Mention hjl.tools@gmail.com in bug URL
      Set BFD version to 2.24.51.0.1
      Remove strayed entry
      Remove CpuNop from CPU_K6_2_FLAGS
      Merge remote-tracking branch 'origin/master' into hjl/linux/master
      Update bfd version to 2.24.51.0.2
      Merge remote-tracking branch 'origin/master' into hjl/linux/master
      Merge remote-tracking branch 'origin/master' into hjl/linux/master
      Make room for PLT0 directly
      Add R_X86_64_PC32_BND and R_X86_64_PLT32_BND
      Merge remote-tracking branch 'origin/master' into hjl/linux/master
      Add R_X86_64_PC32_BND/R_X86_64_PLT32_BND suppor to gold
      Add a dummy "int bnd_prefix" argument
      Update x86 gas tests for mingw
      Re-indent elf_x86_64_section_from_shdr
      Add mpx1static, mpx2 and mpx2static tests
      Add bnd-branch-1 test
      Merge remote-tracking branch 'origin/master' into hjl/linux/master
      Add HOSTING_SLIBS and use it for -pie
      Merge remote-tracking branch 'origin/master' into hjl/linux/master
      Fix a typo
      Merge remote-tracking branch 'origin/master' into hjl/linux/master
      Merge remote-tracking branch 'origin/master' into hjl/linux/master
      Add the missing ChangeLog entry
      Add -ffat-lto-objects to STAGE[23]_CFLAGS
      Add -ldl to POSTSTAGE1_LDFLAGS
      Add -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/
      Remove -lpthread -ldl and add -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/
      Merge remote-tracking branch 'origin/master' into hjl/linux/master
      Add a test for --as-needed with symbol versioning
      Remove shared object from -Ttext-segment
      Set ET_EXEC for -pie -Ttext-segment=
      Add "#..."
      Remove bfd_elf32_bfd_set_private_bfd_flags
      Also copy EI_OSABI field
      Merge remote-tracking branch 'origin/master' into hjl/linux/master
      Apply fixes for PRs 16317/16322
      Merge remote-tracking branch 'origin/hjl/linux/master' into hjl/linux/applied
      Apply binutils-pr16317.patch
      Apply binutils-pr16322.patch
      Update release note for 2.24.51.0.2

Jan Kratochvil (2):
      gdb/NEWS: Fix typo
      Record objfile->original_name as an absolute path

Jan-Benedict Glaw (1):
      2013-11-08  Jan-Benedict Glaw  <jbglaw@lug-owl.de

Joel Brobecker (42):
      Minor reformatting in remote-sim.c (gdbsim_detach declaration).
      Dandling memory pointers in Ada catchpoints with GDB/MI.
      Add command to list Ada exceptions
      Implement GDB/MI equivalent of "info exceptions" CLI command.
      Document "info exceptions" and "-info-ada-exception" new commands.
      Add missing ChangeLog entry for a7e332c24b77168bc61d4ee776bf29c831fbbc88
      Small fix (first word of sentence to start with capital letter)
      crash while re-reading symbols from objfile on ppc-aix.
      Replace "info-ada-exceptions" by "ada-exceptions" in -list-features
      language.h: Add "symtab.h" #include
      New function cli-utils.c:extract_arg_const
      GDB/MI: Add new "--language LANG" command option.
      Fix DW_OP_GNU_regval_type with FP registers
      Start inferior before running test listing Ada exceptions.
      gdb.ada/info_exc.exp,mi_exc_info.exp: handle runtimes with full debug info.
      gdb.ada/info_exc.exp,mi_exc_info.exp: Use more unique exception name.
      Rename "read_reg" into "read_addr_from_reg" in struct dwarf_expr_context_funcs
      Add "language-option" to -list-features
      mi-language.exp: Check "langauge-option" in -list-features output.
      gdb_ari.sh: Remove entries for dirent.h and stat.h.
      Fix int() builtin with range type gdb.Value objects.
      get rid of py-value.c:is_intlike (use is_integral_type instead)
      Makefile.in (HFILES_NO_SRCDIR): Remove "common/gdb_string.h".
      Remove last traces of gdb_stat.h.
      Makefile.in (HFILES_NO_SRCDIR): Remove "common/gdb_dirent.h".
      Fix filestuff.c build error if RLIMIT_NOFILE  not defined.
      New GDB/MI command "-info-gdb-mi-command"
      Add "undefined-command" error code at end of ^error result...
      Remove all trailing spaces in mi/mi-main.c.
      Remove "ada-exceptions" from -list-features output.
      NEWS: Extend documentation of the new GDB/MI --language option.
      crash evaluating bogus exception condition expression (sparc-solaris)
      Ada: Reserved word "all" should not need to be spelled in lowercase.
      Minor coding-style fixes in ada-lex.l:find_dot_all.
      Allow Windows UNWIND_INFO version 2.
      Uninitialized variable "this_id" in frame.c:get_prev_frame_1.
      Document the GDB 7.6.2 release in gdb/ChangeLog
      Fix gdb/ChangeLog date in last entry.
      nameless LOAD_DLL_DEBUG_EVENT causes ntdll.dll to be missing
      GDB/MI: Document support for -exec-run --start in -list-features
      Set language for Ada minimal symbols.
      Add @cindex for section documenting the -list-features GDB/MI command.

Jose E. Marchesi (4):
      2013-11-07  Jose E. Marchesi  <jose.marchesi@oracle.com>
      sparc: support single-stepping over longjmp calls.
      testsuite: handle SIGLOST/SIGPWR conflict in sparc64-*-linux-gnu targets.
      Fixed typo in date in testsuite/ChangeLog entry

Keith Seitz (4):
      Fix regressions caused by const-ify linespec patch:
      PR c++/7539
      Fix PR # dyslexia in ChangeLog for previous commit. It should have
      PR c++/14819:  Explicit class:: inside class scope does not work

Keven Boell (1):
      testsuite: introduce index in varobj child eval.

Kyrylo Tkachov (1):
      [ld/testsuite/]

Luis Machado (2):
      * lib/mi-support.exp (mi_gdb_test): Expect different formats
      * gdb.base/callfuncs.c (main): Assign malloc's return value

Maciej W. Rozycki (1):
      MIPS/opcodes: Add MFCR and MTCR data dependencies

Michael Zolotukhin (1):
      Reorder invalid default mask check

Mike Frysinger (3):
      gdb: testsuite: fix ksh shebang to use sh
      strip off +x bits on non-executable/script files
      sim: bfin: tests: make run-tests.sh executable

Nick Clifton (8):
      * rescoff.c (write_coff_file): Use 64-bit alignment for resource
      PR ld/16082
      PR ld/16017
      * config/tc-aarch64.c (parse_sys_reg): Do not issue error messages
      * scripttempl/elf32msp430.sc (.data): Set the based on the next
      PR ld/16192
      * peXXigen.c (pe_print_resource_entries): New function: Displays
      * s390-mkopc.c (dumpTable): Provide a format string to printf so

Omair Javaid (1):
      testsuite/gdb.dwarf2: dw2-case-insensitive.exp: p fuNC_lang fails on arm

Pedro Alves (36):
      infrun.c:handle_inferior_event: Don't fall through in TARGET_WAITKIND_LOADED handling.
      infrun.c:handle_inferior_event: Move comment.
      infrun.c: Don't set ecs->random_signal for "catchpoint" events (eliminate ecs->random_signal).
      infrun.c:handle_inferior_event: Rework random signal checks.
      Eliminate enum bpstat_signal_value, simplify random signal checks further.
      infrun.c: Split handle_inferior_event further.
      infrun.c:handle_signal_stop: Move initial connection/attachment handling code earlier.
      Simplify dwarf2-frame.c:read_addr_from_reg.
      Make the maint.exp:'maint print objfiles' test less fragile.
      Add missing ChangeLog entry.
      Don't let two frames with the same id end up in the frame chain.
      Make use of the frame stash to detect wider stack cycles.
      Eliminate dwarf2_frame_cache recursion, don't unwind from the dwarf2 sniffer (move dwarf2_tailcall_sniffer_first elsewhere).
      Revert "Eliminate dwarf2_frame_cache recursion, don't unwind from the dwarf2 sniffer (move dwarf2_tailcall_sniffer_first elsewhere)."
      Revert "Make use of the frame stash to detect wider stack cycles."
      Revert "Don't let two frames with the same id end up in the frame chain."
      Eliminate dwarf2_frame_cache recursion, don't unwind from the dwarf2 sniffer (move dwarf2_tailcall_sniffer_first elsewhere).
      Don't let two frames with the same id end up in the frame chain.
      Make use of the frame stash to detect wider stack cycles.
      Rename gdb.dwarf2/dw2-bad-cfi.* to gdb.dwarf2/dw2-unspecified-ret-addr.*.
      Make "set debug frame 1" output print <not saved> instead of <optimized out>.
      Fix type of not saved registers.
      Fix PR 16152's ChangeLog entry.
      register: "optimized out" -> "not saved".
      get_prev_frame, UNWIND_NULL_ID -> UNWIND_OUTERMOST
      get_prev_frame, outer_frame_id and unwind->stop_reason checks are redundant.
      get_prev_frame, stop_reason != UNWIND_NO_REASON, add frame debug output.
      Plug target side conditions and commands leaks.
      UNWIND_NULL_ID is no longer used anywhere.  Update comments.
      Handle 'k' packet TARGET_CLOSE_ERROR gracefully.
      gnulib's sys/stat.h always defines S_IRGRP, S_IXGRP, S_IXOTH.
      Add new target_read_raw_memory function, and consolidate comments.
      New OPTIMIZED_OUT_ERROR error code.
      Fix "info frame" in the outermost frame.
      Eliminate UNSUPPORTED_ERROR.
      breakpoint.c:insert_bp_location: Constify local.

Phil Muldoon (4):
      2013-11-07  Phil Muldoon  <pmuldoon@redhat.com>
      2013-11-07  Phil Muldoon  <pmuldoon@redhat.com>
      2013-11-07  Phil Muldoon  <pmuldoon@redhat.com>
      2013-11-11  Phil Muldoon  <pmuldoon@redhat.com>

Pierre Muller (1):
      Fix completion for pascal language.

Richard Sandiford (1):
      binutils/testsuite/

Roland McGrath (4):
      Set CPU type in BFD backend for x86_64-nacl* and i?86-nacl* targets
      Fix references to __ehdr_start when it cannot be defined
      Fix *-nacl* target objcopy/strip of binary made with custom linker script
      Use $(INSTALL_PROGRAM_ENV) consistently.

Samuel Bronson (2):
      MAINTAINERS (Write After Approval): Add myself to the list.
      Resurrect gdb-add-index as a contrib script

Sanimir Agovic (1):
      test: test eval routines with EVAL_AVOID_SIDE_EFFECTS flag set

Senthil Kumar Selvaraj (1):
      * scripttempl/avr.sc: Set .data section's LMA to next available

Sergio Durigan Junior (2):
      Remove gdb_string.h from gdbarch.sh
      Sanitize access to gdbarch on the SDT probe API (and fix ARM bug)

Siva Chandra (1):
      2013-12-12  Siva Chandra Reddy  <sivachandra@google.com>

Steffen Sledz (1):
      gdb: fix cygwin check in configure script

Sterling Augustine (2):
      2013-11-22  Sterling Augustine  <saugustine@google.com>
      2013-11-22  Sterling Augustine  <saugustine@google.com>

Steve Ellcey (1):
      2013-11-25  Steve Ellcey  <sellcey@mips.com>

Tom Tromey (42):
      constify to_detach
      introduce common.m4
      remove link.h checks
      use gdb_string.h in m32c-tdep.c
      gdb configure updates
      fix a comment in configure.ac
      remove unused gdbserver configury
      fix "tkill" check
      fix multi-arch-exec for parallel mode
      off-by-one fix for py-linetable.c
      fix grammar oddity in the manual
      print summary from "make check"
      fix PR c++/16117
      link gdbreplay against gnulib
      change how list of modules is computed
      import strstr and strerror modules
      remove gdb_string.h
      don't check for string.h or strings.h
      import gnulib dirent module
      remove gdb_dirent.h
      don't check for stddef.h
      stdlib.h is universal too
      don't check for unistd.h
      sys/types.h cleanup
      import gnulib sys/stat.h module
      remove gdb_stat.h
      remove strerror module
      Detect infinite loop in value_fetch_lazy's lval_register handling.
      handle an unspecified return address column
      update comment in dw2-bad-cfi.S.
      revert patch from 2013-11-22
      add "dir" menu item for gdbserver
      add @kindex for catchpoints
      remove some sym_probe_fns methods
      make symtab::filename const
      make symtab::dirname const
      put the psymtab filename in the filename bcache
      fix a couple of FIXMEs
      pack partial_symtab for space
      remove unnecessary declaration
      remove objfile_to_front
      update free_objfile comment

Tristan Gingold (5):
      Fix version.dll binutils test on non native platforms
      Improve dump of xdata/pdata on x86_64.
      Fix crash on intelbad.
      Clear allocated target data.
      Add epilog unwind for x86_64 pe/coff

Walfred Tedeschi (9):
      Fix conditions in creating a bitfield.
      Add MPX registers XML files.
      Add MPX support for i386
      MPX for amd64
      Add MPX support to gdbserver.
      Add pretty-printer for MPX bnd registers.
      Add MPX registers tests.
      Fix PR16193 - gdbserver aborts.
      Documentation for MPX.

Will Newton (8):
      sim/arm: Prevent NULL pointer dereference in sim_create_inferior.
      sim/arm: Prevent crash when running sim with no binary.
      sim/ChangeLog: Correct bug number in previous commit.
      ld/ARM: Fix script-type testsuite failure.
      gdb/arm-tdep.c: Remove "Infinite loop detected" error message.
      bfd/elfnn-aarch64.c: Fix miscalculation of GOTPLT offset for ifunc syms.
      bfd/elfnn-aarch64.c: Handle static links with ifunc correctly.
      ld/testsuite/ld-aarch64: Fixup IFUNC tests to work on all targets

Yao Qi (36):
      Constify 'la_name' in struct language_defn
      New field 'la_natural_name' in struct language_defn
      Remove varobj_language_string, languages and varobj_languages
      Fix typo
      Remove 'whatever' in lib/mi-support.exp
      Fix format issues in lib/mi-support.exp
      Remove unnecessary '\'.
      Move changelog entry to the right ChangeLog
      Remove last_cache
      Don't update target_dcache if it is not initialized
      Move target-dcache out of target.c
      Don't stress 'remote' in "Data Caching" in doc
      Add REGISTRY for struct address_space.
      Associate target_dcache to address_space.
      set_address_space_data if dcache is NULL.
      s/see @pxref/@pxref in doc
      Doc 'dynamic' for command -var-list-children
      Use mi_create_floating_varobj
      Check has_more in mi_create_dynamic_varobj
      Update doc on displayhint in command -var-list-children
      Write "ON" and "OFF" in lower case in GDB doc.
      GDB perf test on single step
      Renaming in target-dcache.c
      set/show code-cache
      Use target_read_code in disassemble.
      GDB perf test on backtrace
      GDB perf test on disassemble
      Delegate to target_ops->beneath for TARGET_OBJECT_RAW_MEMORY
      Fix typo "checksm"
      Fix PR remote/15974
      Avoid "may be used uninitialized" warning
      Use gdb_produce_source
      Invalidate target cache before starting to handle event.
      Use target_read_code in skip_prologue (i386)
      Use target_read_code in skip_prologue (amd64)
      Fix a bug in matching notifications.

Yufeng Zhang (8):
      * elfxx-aarch64.c (_bfd_aarch64_elf_grok_prstatus): Fix hard-coded
      bfd/
      gas/
      Revert "Add support for AArch64 trace unit registers."
      gas/
      Add support for armv7ve to gas.
      Revert "Do not issue error messages when parsing a PSTATE register".
      gas/testsuite/

bviyer (2):
      Added Cilk runtime library (libcilkrts) into GCC.
      Disable libcilkrts when C++ is not used.

ccoutant (1):
      Fix demangler to handle conversion operators correctly.

gary (1):
      libiberty/ 2013-10-25 Gary Benson <gbenson@redhat.com>

gerald (3):
      Fix up ChangeLog entries (name, e-mail, formatting, otherwise).
      * testsuite/test-expandargv.c: Include unistd.h.
      * testsuite/test-demangle.c: Include unistd.h.

glisse (1):
      2013-10-29 Marc Glisse <marc.glisse@inria.fr>

jason (1):
      / * Makefile.tpl (STAGE1_CONFIGURE_FLAGS): Pass --disable-build-format-warnings. gcc/ * configure.ac (loose_warn): Add -Wno-format if --disable-build-format-warnings.

law (1):
      * Makefile.def (target_modules): Remove libmudflap (languages): Remove check-target-libmudflap). * Makefile.in: Rebuilt. * Makefile.tpl (check-target-libmudflap-c++): Remove. * configure.ac (target_libraries): Remove target-libmudflap. Remove checks which disabled libmudflap on some systems. * configure: Rebuilt. * libmudflap: Directory removed.

rsandifo (1):
      include/ * longlong.h: New file.

schwab (1):
      config/ * picflag.m4 (m68k-*-*): Use default PIC flag.

sterling (1):
      2013-10-22 Sterling Augustine <saugustine@google.com>

tschwinge (2):
      * Makefile.tpl: Fix typo. * Makefile.in: Regenerate.
      * Makefile.in: Regenerate.

uros (1):
      * cp-demangle.c (d_copy_templates): Cast result of malloc to (struct d_print_template *). (d_print_comp): Cast result of realloc to (struct d_saved scope *).

-----------------------------------------------------------------------
Comment 14 Doug Evans 2015-09-07 04:05:35 UTC
Another fun aspect of GNU strip is that it can change the in memory size of the TLS segment. This is totally broken but whatever.
Comment 15 Sourceware Commits 2018-08-19 15:05:00 UTC
The master branch has been updated by Simon Marchi <simark@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=be2d111a878e1422c921226bc7714131a5c470fa

commit be2d111a878e1422c921226bc7714131a5c470fa
Author: Michael Spang <spang@google.com>
Date:   Sun Aug 19 10:55:58 2018 -0400

    Fix debugging of stripped PIE executables with padded PT_TLS
    
    Certain PIE executables produced by gold cannot be debugged by gdb after
    being stripped. GDB requires program headers of PIE executables to match,
    and those checks may fail due to adjustments made during stripping.
    
    One case of this occurs because strip recomputes the memsz of PT_TLS and
    does not add alignment, while gold does. This is another variant of PR
    11786, so apply the same fix of relaxing the program header matching.
    
    gdb/ChangeLog:
    
    	PR gdb/11786
    	* solib-svr4.c (svr4_exec_displacement): Ignore memsz fields
    	for PT_TLS segments.
    
    gdb/testsuite/ChangeLog:
    
    	PR gdb/11786
    	* gdb.base/gcore-tls-pie.c: New file.
    	* gdb.base/gcore-tls-pie.exp: New file.
Comment 16 Hannes Domani 2024-01-14 14:36:57 UTC
(In reply to Sourceware Commits from comment #15)
> The master branch has been updated by Simon Marchi <simark@sourceware.org>:
> 
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;
> h=be2d111a878e1422c921226bc7714131a5c470fa
> 
> commit be2d111a878e1422c921226bc7714131a5c470fa
> Author: Michael Spang <spang@google.com>
> Date:   Sun Aug 19 10:55:58 2018 -0400
> 
>     Fix debugging of stripped PIE executables with padded PT_TLS
>     
>     Certain PIE executables produced by gold cannot be debugged by gdb after
>     being stripped. GDB requires program headers of PIE executables to match,
>     and those checks may fail due to adjustments made during stripping.
>     
>     One case of this occurs because strip recomputes the memsz of PT_TLS and
>     does not add alignment, while gold does. This is another variant of PR
>     11786, so apply the same fix of relaxing the program header matching.
>     
>     gdb/ChangeLog:
>     
>     	PR gdb/11786
>     	* solib-svr4.c (svr4_exec_displacement): Ignore memsz fields
>     	for PT_TLS segments.
>     
>     gdb/testsuite/ChangeLog:
>     
>     	PR gdb/11786
>     	* gdb.base/gcore-tls-pie.c: New file.
>     	* gdb.base/gcore-tls-pie.exp: New file.

Can this be closed?