[llvm-commits] [PATCH] Common symbols aren't aligned in RuntimeDyld

Jim Grosbach grosbach at apple.com
Fri Oct 12 13:58:11 PDT 2012


On Oct 12, 2012, at 1:50 PM, Amara Emerson <amara.emerson at gmail.com> wrote:

> That makes sense, some refactoring should allow it to be moved into
> RuntimeDyldELF.
> 
Perfect. Thanks!

> Regarding the use of ObjectFile in the first place, do you think
> adding getSymbolValue() stubs to MachO and COFF are reasonable? I'm
> not keen on the idea, but the abstraction doesn't leave any other
> options that I can see.

I'm not sure I see much alternative, either. Eric, any thoughts on approach there?

> 
> Amara
> 
> On 12 October 2012 19:47, Jim Grosbach <grosbach at apple.com> wrote:
>> The getObjFormat() is breaking the intended abstraction. If there's file format specific logic required, that should be in the platform specific bits. RuntimeDyldELF in this case.
>> 
>> Note that this is a good example of why I still don't much like the use of the libObject ObjectBuffer stuff here (totally not your fault, just a general observation). Eric, if you're still keen to clean some of this stuff up, here's one for you. ;)
>> 
>> -Jim
>> On Oct 12, 2012, at 7:05 AM, Amara Emerson <amara.emerson at arm.com> wrote:
>> 
>>> A new patch to use the OffsetToAlignment function in MathExtras.h, recommended by Tim during review of the lli alignment patch, instead of manual alignment offset calculation.
>>> 
>>> Amara
>>> 
>>> -----Original Message-----
>>> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Amara Emerson
>>> Sent: 12 October 2012 13:45
>>> To: llvm-commits at cs.uiuc.edu
>>> Subject: [llvm-commits] [PATCH] Common symbols aren't aligned in RuntimeDyld
>>> 
>>> Hi,
>>> 
>>> I noticed that common symbols in the RuntimeDyld do not have their alignment
>>> requirements honoured at all. For ELF relocatable objects, the value field
>>> of a common symbol in the symbol table is used to encode the alignment
>>> requirement. However, there seems to be no way to retrieve this information
>>> currently and so the symbols cannot be aligned.
>>> 
>>> The patch fixes this by adding a hook into ELFObjectFile to return the value
>>> of a symbol, and ensures proper alignment. The solution currently applies to
>>> ELF only, the relevant hooks in MachO and COFF have been stubbed for now. A
>>> test case is included as well.
>>> 
>>> Please review the attached patch.
>>> 
>>> Amara<common-symbol-alignment-revised1.patch>_______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list