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

Jim Grosbach grosbach at apple.com
Fri Oct 12 11:47:05 PDT 2012


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




More information about the llvm-commits mailing list