public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: binutils@sources.redhat.com
Subject: Re: RFA: Fix both_direction
Date: Mon, 16 May 2005 16:21:00 -0000	[thread overview]
Message-ID: <20050516142828.GA24614@nevyn.them.org> (raw)
In-Reply-To: <20050511173152.GA29720@nevyn.them.org>

On Wed, May 11, 2005 at 01:31:53PM -0400, Daniel Jacobowitz wrote:
> This patch fixes "gdb -write" support for ELF files.  There are two
> problems:
> 
> We try to write out the string table even if we didn't create one. If we've
> bypassed the normal output routines, we never initialize elf_shstrtab, which
> is otherwise OK.  If it's not set, there's nothing we need to do (except not
> crash).
> 
> With that fixed, gdb -write works - as long as you change something, thereby
> encountering the "output_has_begun = TRUE" in bfd_set_section_contents.  If
> you don't, then the linker's output routines are called.  This causes
> sections to get rearranged, destroys special program headers (like
> PT_GNU_STACK), and loses the static symbol table.  I believe that the
> check_format hook is a better place to handle this.
> 
> OK?  Tested on i686-linux, using the binutils testsuite, the gdb testsuite,
> and manual testing of gdb -write (which needs some testsuite coverage of its
> own).

> 2005-05-11  Daniel Jacobowitz  <dan@codesourcery.com>
> 
> 	* elf.c (_bfd_elf_write_object_contents): Check for non-NULL
> 	elf_shstrtab.
> 	* format.c (bfd_check_format_matches): Set output_has_begun
> 	for both_direction.
> 	* section.c (bfd_set_section_contents): Use bfd_write_p.  Remove
> 	special case for both_direction.

Ping?

-- 
Daniel Jacobowitz
CodeSourcery, LLC

  reply	other threads:[~2005-05-16 14:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-11 18:05 Daniel Jacobowitz
2005-05-16 16:21 ` Daniel Jacobowitz [this message]
2005-05-17  7:39   ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050516142828.GA24614@nevyn.them.org \
    --to=drow@false.org \
    --cc=binutils@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).