public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Olivier Hainque <hainque@adacore.com>
To: gcc-patches@gcc.gnu.org, rsandifo@nildram.co.uk
Cc: hainque@adacore.com
Subject: Re: [PATCH] restore NOSTRIP for .debug_frame on mips-irix
Date: Wed, 10 Oct 2007 14:25:00 -0000	[thread overview]
Message-ID: <20071010142544.GA26713@cardhu.act-europe.fr> (raw)
In-Reply-To: <87bqb8gi2z.fsf@firetop.home>

[-- Attachment #1: Type: text/plain, Size: 1313 bytes --]

Hello Richard,

Richard Sandiford wrote:
> If we need this bit set for correctness, I think GAS should add it
> automatically when the GAS (rather than IRIX) .section syntax is
> used.

 The patch was simply modeled after what the compiler used to do.
 I agree that dealing with this in GAS looks cleaner.

> GAS already knows that certain sections are special in certain ways,

 Indeed.

> and if proper behaviour requires a GAS change too, I
> suppose users will have to upgrade to newer binutils either way.

 Actually, we had observed the behavior with 2.16, this led to a
 discussion with a patch suggestion at

    http://www.cygwin.com/ml/binutils/2005-02/msg00688.html

 The patch was approved but apparently didn't go in and I was
 assuming it was still needed.

 However, I just tried my patched compiler with untouched 2.17 and
 2.18 assemblers and both seem to propagate the extra NOSTRIP bit, so
 something else happened.

 Anyway, _bfd_mips_elf_fake_sections in bfd/elfxx-mips.c still really
 looks like the proper place to have this change as there is a lot of
 similar processing there already.

 The attached patch fixes the tiny case I posted, and I'd be happy to
 submit it to the binutils list after the required testing if you think
 is appropriate.

 Thanks for your feedback,

 Olivier


 

[-- Attachment #2: mips-debug_frame_nostrip.dif --]
[-- Type: text/plain, Size: 1008 bytes --]

*** bfd/elfxx-mips.c.ori	2007-10-10 09:28:42.715483416 -0400
--- bfd/elfxx-mips.c	2007-10-10 09:56:46.514369373 -0400
*************** _bfd_mips_elf_fake_sections (bfd *abfd, 
*** 5670,5676 ****
        hdr->sh_flags |= SHF_MIPS_NOSTRIP;
      }
    else if (CONST_STRNEQ (name, ".debug_"))
!     hdr->sh_type = SHT_MIPS_DWARF;
    else if (strcmp (name, ".MIPS.symlib") == 0)
      {
        hdr->sh_type = SHT_MIPS_SYMBOL_LIB;
--- 5670,5684 ----
        hdr->sh_flags |= SHF_MIPS_NOSTRIP;
      }
    else if (CONST_STRNEQ (name, ".debug_"))
!     {
!       hdr->sh_type = SHT_MIPS_DWARF;
! 
!       /* Irix facilities such as libexc expect a single .debug_frame
! 	 per executable, the system ones have NOSTRIP set and the linker
! 	 doesn't merge sections with different flags so ...  */
!       if (SGI_COMPAT (abfd) && CONST_STRNEQ (name, ".debug_frame"))
! 	hdr->sh_flags |= SHF_MIPS_NOSTRIP;
!     }
    else if (strcmp (name, ".MIPS.symlib") == 0)
      {
        hdr->sh_type = SHT_MIPS_SYMBOL_LIB;

  reply	other threads:[~2007-10-10 14:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-08  9:33 Olivier Hainque
2007-10-09 20:16 ` Richard Sandiford
2007-10-10 14:25   ` Olivier Hainque [this message]
2007-10-10 15:00     ` Richard Sandiford
2007-10-10 15:07       ` Olivier Hainque

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=20071010142544.GA26713@cardhu.act-europe.fr \
    --to=hainque@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rsandifo@nildram.co.uk \
    /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).