This is the mail archive of the binutils@sourceware.org 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: Reuse of reloc_howto_type depending on section


Hi Martin,

    case SPEAR32_OPERAND_SIMM8:
      fixP->fx_pcrel = 0;

      if (fixP->fx_cgen.opinfo != 0)
        type = fixP->fx_cgen.opinfo;

But at this point you also have access to fixP->fx_add_symbol. So you can transform the basic relocation type that you are extracting from fixP->fx_cgen.opinfo. eg:


     if (fixP->fx_cgen.opinfo != 0)
       {
         type = fixP->fx_cgen.opinfo;
         if (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_CODE)
           type += 1;
       }

(I have assumed here that you have arranged for the ..._TEXT versions of the relocs to have a numerical value of 1 more than their corresponding data address space versions).

Cheers
  Nick


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