public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* GAS reloc->addend
@ 2004-10-13 12:43 Vineet Sharma
  2004-10-14  5:51 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Vineet Sharma @ 2004-10-13 12:43 UTC (permalink / raw)
  To: binutils

Hi,
       I am porting binutils 2.15 for new 16 bit processor. I have some query :

Q1. Regarding the role of reloc_entry->addend.
I want to know how does the genreic part fills up this value and what does it symbolises. ?




Q2. If in GAS function coff_XXX_reloc() i want to identify the section of the symbol(symbol_in parameter) in question.
     I tried "symbol_in->section->flags & SEC_CODE" the flag are not set and always fails in GAS(but works properly in linker). Any hints?




Thanks and Regards
Vineet

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

* Re: GAS reloc->addend
  2004-10-13 12:43 GAS reloc->addend Vineet Sharma
@ 2004-10-14  5:51 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2004-10-14  5:51 UTC (permalink / raw)
  To: Vineet Sharma; +Cc: binutils

"Vineet Sharma" <Vineet.Sharma@noida.hcltech.com> writes:

>        I am porting binutils 2.15 for new 16 bit processor. I have some query :
> 
> Q1. Regarding the role of reloc_entry->addend.
> I want to know how does the genreic part fills up this value and what does it symbolises. ?

The generic code does not set reloc_entry->addend.  It is set by
tc_gen_reloc().  Unfortunately, it is then modified by code in
BFD--code which is also CPU-specific.  Getting these to work together
correctly is a real pain.  See the discussion in bfd/doc/bfdint.texi.

> Q2. If in GAS function coff_XXX_reloc() i want to identify the section of the symbol(symbol_in parameter) in question.
>      I tried "symbol_in->section->flags & SEC_CODE" the flag are not set and always fails in GAS(but works properly in linker). Any hints?

You should probably be using
    subseg_text_p (S_GET_SEGMENT (symbol_in))
However, the result should be more or less the same, and I don't know
why it does not work offhand.

Ian

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

end of thread, other threads:[~2004-10-14  5:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-13 12:43 GAS reloc->addend Vineet Sharma
2004-10-14  5:51 ` Ian Lance Taylor

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