Displaying 3 results from an estimated 3 matches for "output_section".
2017 Sep 19
1
Do I need to modify the AddrLoc of LLD for ARC target?
...ARC_COMPACT ||
+ Config->EMachine == EM_ARC_COMPACT2)) {
+ uint64_t M = 0;
+ if (Type == R_ARC_32_PCREL || Type == R_ARC_PC32 ||
+ Type == R_ARC_GOTPC32 || Type == R_ARC_GOTPC)
+ M = 4; // bitsize >= 32 ? 4 : 0
+ AddrLoc = (getOutputSection()->Addr /* output_section->vma */ +
+ cast<InputSection>(this)->OutSecOff /* output_offset */ +
+ Offset /* reloc_offset */ - M) & ~0x3;
+ }
uint64_t TargetVA = SignExtend64(
getRelocTargetVA(Type, Rel.Addend, AddrLoc, *Rel.Sym, Expr), Bits);
Looking at your calcul...
2017 Sep 14
4
Do I need to modify the AddrLoc of LLD for ARC target?
...2058
>
> DEBUG: lld: R_ARC_S25W_PCREL TargetVA: 4 A: 0 P: 8 <-- different P?
> DEBUG: lld: R_ARC_S25W_PCREL: Insn: 2050 Rel: 1
> DEBUG: lld: R_ARC_S25W_PCREL: Insn: 2054 <-- different relocation value
>
> How arc-ld calculates P?
>
> P = ((reloc_data.input_section->output_section ?
> reloc_data.input_section->output_section->vma : 0) +
> reloc_data.input_section->output_offset + (reloc_data.reloc_offset -
> (reloc_data.bitsize >= 32 ? 4 : 0))) & ~0x3;
>
> for example, R_ARC_S25W_PCREL's bitsize < 32, P = (6 + 0 + 0 - 0) & ~0x3 =
>...
2017 Sep 18
1
Do I need to modify the AddrLoc of LLD for ARC target?
...gt;>> DEBUG: lld: R_ARC_S25W_PCREL: Insn: 2050 Rel: 1
>>>>> DEBUG: lld: R_ARC_S25W_PCREL: Insn: 2054 <-- different relocation value
>>>>>
>>>>> How arc-ld calculates P?
>>>>>
>>>>> P = ((reloc_data.input_section->output_section ?
>>>>> reloc_data.input_section->output_section->vma : 0) +
>>>>> reloc_data.input_section->output_offset + (reloc_data.reloc_offset -
>>>>> (reloc_data.bitsize >= 32 ? 4 : 0))) & ~0x3;
>>>>>
>>>>> for examp...