From: Neil Mayes <neil.mayes@googlemail.com>
To: gcc-help@gcc.gnu.org
Subject: Re: Sparc RELA incorrect addend
Date: Tue, 17 Feb 2009 14:56:00 -0000 [thread overview]
Message-ID: <d6d1fd640902170656t487c8e3j55c74b86c3765c72@mail.gmail.com> (raw)
In-Reply-To: <d6d1fd640902170434r72c6a1afpe5d4f78f954ca339@mail.gmail.com>
Hi,
On closer inspection it's a little worse. I have a local global
variable which is located in .data @ 0x020005AC whereas the rela tells
me its within the .text section. Symbol value == 0x02000000 (.text
vitual address) with an addend == 0x020005AC, which is actually the
absolute address. Looking through binutils I can see for a global
symbol there is the following comment:
/* To avoid generating warning messages about truncated relocations,
set the relocation's address to be the same as the start of this
section. */
It's strange that it's not got the correct section ID as well as an
incorrect addend. If I turn it into a global global everything is OK
with addend set to zero.
This is using GNU ld (GNU Binutils) 2.18
Supported emulations:
elf32_sparc
Thanks,
Neil
2009/2/17 Neil Mayes <neil.mayes@googlemail.com>:
> Hi,
>
> I am implementing a dynamic task loader for RTEMS using a Sparc ERC32.
> I have been looking in what is invloved and what I need to do in order
> to relocate the code however I have seen the relocations which use an
> addend are incorrect, the addend is the absolute value not the offset
> from the symbol value. I have had a look at the bugs but can't find
> this one.
>
> Has anyone any knowledge of this issue?
>
> I am using GCC version 4.2.2
>
> Thanks,
> Neil
>
next prev parent reply other threads:[~2009-02-17 14:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-17 12:37 Neil Mayes
2009-02-17 14:56 ` Neil Mayes [this message]
2009-02-17 20:36 ` Ian Lance Taylor
2009-02-17 20:54 ` Neil Mayes
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=d6d1fd640902170656t487c8e3j55c74b86c3765c72@mail.gmail.com \
--to=neil.mayes@googlemail.com \
--cc=gcc-help@gcc.gnu.org \
/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).