[llvm-commits] LLD Add x86 relocation reference code
Michael Spencer
bigcheesegs at gmail.com
Wed Oct 24 16:27:37 PDT 2012
On Wed, Oct 24, 2012 at 11:22 AM, Sid Manning <sidneym at codeaurora.org> wrote:
> On 10/22/12 16:39, Michael Spencer wrote:
>>
>> On Fri, Oct 19, 2012 at 3:15 PM, Sid Manning<sidneym at codeaurora.org>
>> wrote:
>>>
>>>
>>> This attached change does the following:
>>> * Moves x86 content from ReferenceKinds.cpp to a new file,
>>> x86Reference.cpp
>>> * Adds support for R_386_32 and R_386_PC32 relocs
>>> * Includes simple testcase
>>>
>>>
>>> --
>>> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
>>> by
>>> The Linux Foundation
>>
>>
>> The filename should be X86Reference.cpp.
>>
>> Also the class should be X86KindHandler (arch name goes first
>> everywhere else in llvm).
>>
>> The relocation handlers should be named relocNONE, relocPC32, etc...
>
>
> I made the above name changes and change PPC and Hexagon too so this
> contains two attachments. One, "rename.diff" that rename the code that is
> currently in svn and two, "add-x86-ref-support2.diff" that includes the name
> changes and other concerns.
>
>
>>
>>> + std::map<int32_t,
>>> + int (*)(uint8_t *location, uint64_t fixupAddress,
>>> + uint64_t targetAddress, uint64_t addend)>
>>> _fixupHandler;
>>
>>
>> This should probably use std::function.
>
> OK.
>
>>
>> - Michael Spencer
>
>
> Thanks,
>
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
> The Linux Foundation
+void X86KindHandler::applyFixup(int32_t reloc, uint64_t addend,
+ uint8_t *location, uint64_t fixupAddress,
+ uint64_t targetAddress) {
Line these arguments up with the one above.
+ int error;
+ if (_fixupHandler[reloc])
+ {
No new line after ).
+ error = (_fixupHandler[reloc])(location,
+ fixupAddress, targetAddress, addend);
+ }
And fix the Added thing that Eric mentioned.
With those changes you can commit.
- Michael Spencer
More information about the llvm-commits
mailing list