[llvm-commits] Atom alignment
Sid Manning
sidneym at codeaurora.org
Tue Oct 23 09:18:38 PDT 2012
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.
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
More information about the llvm-commits
mailing list