public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Minor coding nitpick in binutils/bfd/elf32-v850.c
@ 2004-05-10 15:43 Bernd Jendrissek
  2004-05-11 16:27 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Jendrissek @ 2004-05-10 15:43 UTC (permalink / raw)
  To: binutils

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Excuse me, can I ask a small question?

What's this?

binutils/bfd/elf32-v850.c: v850_elf_final_link_relocate():

    case R_V850_SDA_16_16_SPLIT_OFFSET:
	...
        value -= sym_sec->output_section->vma;
        value -= (gp - sym_sec->output_section->vma);


That's just equivalent to (*)
        value -= gp;

Other relocs nearby also do that v -= x; v -= (y - x); dance.

I must be missing something...

(*) <selects appropriate signature>

- -- 
http://voyager.abite.co.za/~berndj/ (f1084a555d2098411cff4cefd41d2e2a1c85d18c)
I've generally found that the fastest way to get the right answer on the net
is to confidently assert the answer you believe to be right; those who know
will immediately correct you, while if you just ask, often no answers arrive.
All it requires is a willingness to look bad on occasion.
                                               - Joe Buck on gcc@gcc.gnu.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFAn6HJ/FmLrNfLpjMRAtEHAKCIBdYjbIkItFXmQvjjVW6WoOFLQwCeOUsg
4aXVPvmfRGURp2J0PZw0uyE=
=3swa
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Minor coding nitpick in binutils/bfd/elf32-v850.c
  2004-05-10 15:43 Minor coding nitpick in binutils/bfd/elf32-v850.c Bernd Jendrissek
@ 2004-05-11 16:27 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2004-05-11 16:27 UTC (permalink / raw)
  To: Bernd Jendrissek; +Cc: binutils

Hi Bernd,

>What's this?
>
>binutils/bfd/elf32-v850.c: v850_elf_final_link_relocate():
>
>    case R_V850_SDA_16_16_SPLIT_OFFSET:
>	...
>        value -= sym_sec->output_section->vma;
>        value -= (gp - sym_sec->output_section->vma);
>
>
>That's just equivalent to (*)
>        value -= gp;
>  
>
True.  The intention was that the code would show how the adjustments to 
"value" were computed.  The first line demonstrates "value" being turned 
into a section relative offset.  The second line demonstrates "value" 
then being made into a gp and section relative offset.  My assumption 
was that the compiler would eliminate the redundancy in the computation 
so having it in the sources would not impose any unnecessary overheads 
on the linker.

Cheers
  Nick

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-11 16:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-10 15:43 Minor coding nitpick in binutils/bfd/elf32-v850.c Bernd Jendrissek
2004-05-11 16:27 ` Nick Clifton

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).