[llvm-commits] Atom alignment

Sid Manning sidneym at codeaurora.org
Wed Oct 24 16:08:13 PDT 2012


On 10/23/12 11:18, Sid Manning wrote:
> On 10/23/12 10:34, Evandro Menezes wrote:
>> On 10/23/12 07:43, Sid Manning wrote:
>>> @@ -640,9 +636,20 @@
>>> symbolData = llvm::ArrayRef<uint8_t>((uint8_t *)symbolContents.data()
>>> + (*si)->st_value, contentSize);
>>> + // Alignment will be equal to st_value when the symbol is a
>>> + // common symbol, otherwise equal to the lesser of either the
>>> + // section's alignment or the symbol's original alignment.
>>> + uint64_t alignment;
>>> + if (isCommon)
>>> + alignment = (*si)->st_value;
>>> + else if ((*si)->st_value == 0)
>>> + alignment = (i.first)->sh_addralign;
>>> + else if ((alignment =
>>> + (1 << (llvm::CountTrailingZeros_64((*si)->st_value) - 1))) >
>> Do not subtract one from the number of trailing zeros, lest you end up
>> with a negative shift count. And you also need to indent this line by
>> one space.
>
> Yes, Shankar mentioned this to me. When I switched from ffs to
> CountTrailingZeros I should have removed the -1.

Attached is the updated patch.


>
> Thanks,
>
>>> + (i.first)->sh_addralign)
>>> + alignment = (i.first)->sh_addralign;
>>> unsigned int referenceStart = _references.size();
>>> -
>>> // Only relocations that are inside the domain of the atom are
>>> // added.
>> HTH
>>
>
>


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ReaderELF-alignment2.diff
Type: text/x-patch
Size: 3295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121024/cadbc09e/attachment.bin>


More information about the llvm-commits mailing list