public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Andrew Morton <akpm@zip.com.au>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Hugh Dickins <hugh@veritas.com>,
	Marcelo Tosatti <marcelo@conectiva.com.br>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] BUG preserve registers
Date: 10 Feb 2002 08:40:22 -0700	[thread overview]
Message-ID: <m1eljt5ord.fsf@frodo.biederman.org> (raw)
In-Reply-To: <Pine.LNX.4.33.0202092211001.10024-100000@home.transmeta.com> <Pine.LNX.4.33.0202092211001.10024-100000@home.transmeta.com> <m1k7tl6ek2.fsf@frodo.biederman.org> <3C66181C.95DF04E3@zip.com.au>
In-Reply-To: <3C66181C.95DF04E3@zip.com.au>

Andrew Morton <akpm@zip.com.au> writes:

> "Eric W. Biederman" wrote:
> > 
> > One possibility is to do something like:
> > 
> > ud2
> > .word __LINE__
> > .long 1f
> > .section __FILE__
> > .linkonce discard
> > 1: .asciz __FILE__
> > .previous
> > 
> > Which will put each filename string in it's own section and let the
> > linker merge the duplicates.
> 
> That would work.  When it didn't I r'ed tfm:
> 
> 	http://www.gnu.org/manual/gas-2.9.1/html_node/as_102.html
> 
> 	"This directive is only supported by a few object file formats;
> 	 as of this writing, the only object file format which supports
> 	 it is the Portable Executable format used on Windows NT."

It is supported for ELF and most other targets, but unfortunately not
with the same syntax :(  I just looked and you have to do it a
slightly different way.  You must prefix section name with  ".gnu.linkonce"

binutils/bfd/elf.c:416
  /* As a GNU extension, if the name begins with .gnu.linkonce, we
     only link a single copy of the section.  This is used to support
     g++.  g++ will emit each template expansion in its own section.
     The symbols will be defined as weak, so that multiple definitions
     are permitted.  The GNU linker extension is to actually discard
     all but one of the sections.  */

This has been supported since 1997 so it should be safe to use.
Though it would be nice if someone would actually document it...

Eric

  reply	other threads:[~2002-02-10 15:44 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-09  8:13 [PATCH] BUG preserve registers Hugh Dickins
2002-02-09  8:32 ` Andrew Morton
2002-02-09 10:33   ` Hugh Dickins
2002-02-09 19:30 ` Linus Torvalds
2002-02-09 19:34   ` Andrew Morton
2002-02-09 21:37     ` Linus Torvalds
2002-02-09 20:00       ` H. Peter Anvin
2002-02-09 21:49         ` Linus Torvalds
2002-02-09 20:24           ` H. Peter Anvin
2002-02-09 20:11       ` Andrew Morton
2002-02-09 20:15         ` Linus Torvalds
2002-02-09 22:07           ` Andrew Morton
2002-02-10  2:41             ` Alan Cox
2002-02-10  4:20               ` Andrew Morton
2002-02-10  4:23                 ` H. Peter Anvin
2002-02-10  4:28                   ` Andrew Morton
2002-02-10  6:16                 ` Linus Torvalds
2002-02-10  5:28                   ` Andrew Morton
2002-02-10  7:23                     ` Linus Torvalds
2002-02-10  6:28                       ` Andrew Morton
2002-02-10  9:05                         ` Andrew Morton
     [not found]                           ` <200202110710.g1B7A5t28328@Port.imtp.ilyichevsk.odessa.ua>
2002-02-11  7:22                             ` Andrew Morton
2002-02-11 17:19                           ` Hugh Dickins
2002-02-11 19:48                             ` Andrew Morton
2002-02-11 20:52                               ` Hugh Dickins
2002-02-10  7:13                       ` H. Peter Anvin
2002-02-10  8:53                         ` arjan
2002-02-11 15:26                     ` Jamie Lokier
2002-02-10  6:23                   ` Eric W. Biederman
2002-02-10  6:50                     ` Andrew Morton
2002-02-10 15:40                       ` Eric W. Biederman [this message]
2002-02-10  7:08                     ` Stevie O
2002-02-10 14:35                   ` Olaf Dietsche
2002-02-10  4:55               ` Linus Torvalds
2002-02-10  5:03               ` Linus Torvalds
2002-02-10  4:21       ` Brian Gerst

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=m1eljt5ord.fsf@frodo.biederman.org \
    --to=ebiederm@xmission.com \
    --cc=akpm@zip.com.au \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=hpa@zytor.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=torvalds@transmeta.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