[llvm] r221639 - [yaml2obj] Support AArch64 relocations.

Simon Atanasyan simon at atanasyan.com
Tue Nov 11 08:59:34 PST 2014


First, it is not a trivial task to escape a code duplication here.
Besides obj2yaml and yaml2obj are auxiliary tools used for testing
only. That is why nobody pay too much attention on their design. If
you have a solution it would be nice to make the code better.

Simon

On Tue, Nov 11, 2014 at 7:38 PM, Daniel Stewart <stewartd at codeaurora.org> wrote:
> It does seem like there are too many places the relocations are defined, and
> I'd like to see it consolidated. This particular patch just followed the
> pattern that was already there. I would think Simon and Shankar would be
> able to give a better answer as to why this is defined as it is.
>
> Daniel
>
> ============================================================================
> ==
>> --- llvm/trunk/lib/Object/ELFYAML.cpp (original)
>> +++ llvm/trunk/lib/Object/ELFYAML.cpp Mon Nov 10 17:02:03 2014
>> @@ -672,6 +672,92 @@ void ScalarEnumerationTraits<ELFYAML::EL
>>      ECase(R_386_IRELATIVE)
>>      ECase(R_386_NUM)
>>      break;
>
> Is this function supposed to be synchronized with lib/Object/ELF.cpp (which
> has one function: getELFRelocationTypeName). Keeping these in synch manually
> seems error-prone (and somewhat silly). Can we refactor this so that we
> don't have two essentially-identical lists of relocation names in the two
> files?

-- 
Simon Atanasyan



More information about the llvm-commits mailing list