From: DJ Delorie <dj@redhat.com>
To: amodra@bigpond.net.au
Cc: aoliva@redhat.com, binutils@sources.redhat.com
Subject: Re: mn10300: relaxing vs section merging
Date: Tue, 25 May 2004 23:14:00 -0000 [thread overview]
Message-ID: <200405252047.i4PKldZK012671@greed.delorie.com> (raw)
In-Reply-To: <20040512013503.GA3055@bubble.modra.org> (message from Alan Modra on Wed, 12 May 2004 11:05:03 +0930)
> > >> > You have to use section-relative relocs with section merging
> >
> > >> Why?
> >
> > > Because _bfd_elf_rela_local_sym() only adjusts STT_SECTION symbols.
> > > If you have other types of symbols, it doesn't seem to adjust the
> > > values properly.
> >
> > Hmm... Maybe it should be improved/fixed, then? I suppose whenever
> > we get called with a symbol, we should figure out in which section it
> > is, find the relocation for the section, and then apply the symbol
> > offset into the section again.
>
> Local symbols in SEC_MERGE sections are adjusted, but too late for
> you when doing relaxing. See elf_link_input_bfd. You can't do the
> adjustment until you know final section layout, because some symbols
> might end up pointing outside their section, or even outside their
> bfd. Of course, you can't make the final section layout until
> relaxing is complete..
>
> I suppose it would be possible to move all the local sym adjustments
> into _bfd_elf_rel{,a}_local_sym. Note that _bfd_elf_rel_local_sym
> looks like it handles any local sym. Beware! _bfd_elf_rel_local_sym
> should be (and is currently) only called on section syms.
Ok, so can I commit my patch then? It sounds like I'm doing the right
thing...
next prev parent reply other threads:[~2004-05-25 20:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-05 18:18 DJ Delorie
2004-05-06 7:14 ` Alexandre Oliva
2004-05-07 1:19 ` DJ Delorie
2004-05-11 22:36 ` Alexandre Oliva
2004-05-12 1:35 ` Alan Modra
2004-05-25 23:14 ` DJ Delorie [this message]
2004-05-25 23:31 ` Alan Modra
2004-05-25 23:43 ` DJ Delorie
2004-05-26 0:02 ` Alan Modra
2004-05-26 0:18 ` DJ Delorie
2004-05-26 1:09 ` Alan Modra
2004-05-28 2:15 ` DJ Delorie
2004-05-28 2:36 ` Alexandre Oliva
2004-05-28 4:11 ` Alexandre Oliva
2004-05-28 4:17 ` DJ Delorie
2004-05-28 4:30 ` Alexandre Oliva
2004-05-28 21:49 ` DJ Delorie
2004-05-28 4:55 ` Alexandre Oliva
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=200405252047.i4PKldZK012671@greed.delorie.com \
--to=dj@redhat.com \
--cc=amodra@bigpond.net.au \
--cc=aoliva@redhat.com \
--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).