This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GAS reloc->addend


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]