[lld] r259847 - Do not round uintX_t to uint32_t.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 15:54:08 PST 2016


On Thu, Feb 4, 2016 at 3:46 PM, David Blaikie <dblaikie at gmail.com> wrote:

>
>
> On Thu, Feb 4, 2016 at 3:39 PM, Rui Ueyama via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: ruiu
>> Date: Thu Feb  4 17:39:33 2016
>> New Revision: 259847
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=259847&view=rev
>> Log:
>> Do not round uintX_t to uint32_t.
>>
>> On 64-bit computers, this value can be larger than UINT32_MAX.
>>
>
> Test case? (I'm assuming this is observable in the output in some way?
> (when linking 64 bit executables (or is it really a matter of the host
> hardware?)?))
>

It should be observable when you link a >4GB binary. Don't know how to
observe other than that way. (I didn't see that, but I noticed that the
code was theoretically wrong when I happened to be reading that.)


>

>> Modified:
>>     lld/trunk/ELF/OutputSections.h
>>
>> Modified: lld/trunk/ELF/OutputSections.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=259847&r1=259846&r2=259847&view=diff
>>
>> ==============================================================================
>> --- lld/trunk/ELF/OutputSections.h (original)
>> +++ lld/trunk/ELF/OutputSections.h Thu Feb  4 17:39:33 2016
>> @@ -130,7 +130,7 @@ public:
>>    // the number of reserved entries. This method is MIPS-specific.
>>    unsigned getMipsLocalEntriesNum() const;
>>
>> -  uint32_t getLocalTlsIndexVA() { return Base::getVA() +
>> LocalTlsIndexOff; }
>> +  uintX_t getLocalTlsIndexVA() { return Base::getVA() +
>> LocalTlsIndexOff; }
>>
>>  private:
>>    std::vector<const SymbolBody *> Entries;
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160204/828f031c/attachment.html>


More information about the llvm-commits mailing list