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

Amara Emerson Amara.Emerson at arm.com
Fri Oct 12 07:05:23 PDT 2012


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: common-symbol-alignment-revised1.patch
Type: application/octet-stream
Size: 15107 bytes
Desc: common-symbol-alignment-revised1.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121012/bfa58fb5/attachment.obj>


More information about the llvm-commits mailing list