[lld] r233057 - [Mips] Support MIPS N64 relocation record format

Simon Atanasyan simon at atanasyan.com
Tue Mar 24 06:17:51 PDT 2015


On Tue, Mar 24, 2015 at 4:02 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
> On Tue, Mar 24, 2015 at 5:57 AM, Simon Atanasyan <simon at atanasyan.com> wrote:
>> +  MipsELFReference(uint64_t symValue, const Elf_Rela &rel)
>> +      : ELFReference<ELFT>(
>> +            &rel, rel.r_offset - symValue, Reference::KindArch::Mips,
>> +            rel.getType(_isMips64EL) & 0xff, rel.getSymbol(_isMips64EL)),
>> +        _tag(rel.getType(_isMips64EL) >> 8) {}
>
> This code is causing a warning in MSVC because rel.getType() returns
> an unsigned char, but you then >> by sizeof(unsigned char). Is that
> intended?

In general it is not a problem because rel.getType() has unsigned char
return type
in case of 32-bit variant of Elf_Rel_Impl only. For 32-bit MIPS ABI
the _tag should
be always zero. 64-bit variant of Elf_Rel_Impl has `uint32_t
getType()` declaration.

Anyway, thanks for the information. I will try to reorganize the code to escape
the warning.

-- 
Simon Atanasyan



More information about the llvm-commits mailing list