[lld] r288581 - [ELF] - Implemented R_386_16 and R_386PC16 relocations

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 05:16:01 PST 2016


George Rimar <grimar at accesssoftek.com> writes:
> Then logic implemented in the patch will work anyways as it truncates
> the output to 16 bits.
>
> At least that was my logic when I implemented that. Was I wrong ?

I think it is still wrong. I will try to write a testcase.

>>
>>> +# RUN: yaml2obj %s -o %t.o
>>
>>Why do you need to use yaml2obj?
>>
>
> First version of patch has code instead. It was 2 files in test which did not clearly showed
> how implementation truncates the relocation (https://reviews.llvm.org/D27303?id=79921).
>
> I found then that with obj2yaml it is possible to show that in a pretty obvious way.
> There relocations are bit special, so I assumed it is fine to have special test for them.

I would much prefer using llvm-mc if at all possible. If you need to
keep everything in one file, use echo like we do for linker scripts.

But why do you need two files? Two sections should be sufficient.

Cheers,
Rafael


More information about the llvm-commits mailing list