[lld] r205654 - [ELF] Diagnose malformed --dynsym option.
Rui Ueyama
ruiu at google.com
Fri Apr 4 15:47:23 PDT 2014
It was typo. Sorry.
On Fri, Apr 4, 2014 at 3:45 PM, Shankar Easwaran <shankare at codeaurora.org>wrote:
> Comment says --dynsym and implementation reflects --defsym.
>
> Incorrect comment ?
>
>
> On 4/4/2014 5:36 PM, Rui Ueyama wrote:
>
>> Author: ruiu
>> Date: Fri Apr 4 17:36:30 2014
>> New Revision: 205654
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=205654&view=rev
>> Log:
>> [ELF] Diagnose malformed --dynsym option.
>>
>> Modified:
>> lld/trunk/lib/Driver/GnuLdDriver.cpp
>> lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp
>>
>> Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/
>> GnuLdDriver.cpp?rev=205654&r1=205653&r2=205654&view=diff
>> ============================================================
>> ==================
>> --- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
>> +++ lld/trunk/lib/Driver/GnuLdDriver.cpp Fri Apr 4 17:36:30 2014
>> @@ -134,7 +134,7 @@ static error_code getFileMagic(ELFLinkin
>> // aliases yet.
>> static bool parseDefsymOption(StringRef opt, StringRef &sym, uint64_t
>> &addr) {
>> size_t equalPos = opt.find('=');
>> - if (equalPos == StringRef::npos)
>> + if (equalPos == 0 || equalPos == StringRef::npos)
>> return false;
>> sym = opt.substr(0, equalPos);
>> if (opt.substr(equalPos + 1).getAsInteger(0, addr))
>>
>> Modified: lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp
>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/
>> DriverTests/GnuLdDriverTest.cpp?rev=205654&r1=205653&r2=205654&view=diff
>> ============================================================
>> ==================
>> --- lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp (original)
>> +++ lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp Fri Apr 4
>> 17:36:30 2014
>> @@ -71,3 +71,13 @@ TEST_F(GnuLdParserTest, DefsymFail) {
>> EXPECT_FALSE(
>> parse("ld", "--start-group", "--end-group", "--defsym=sym=abc",
>> nullptr));
>> }
>> +
>> +TEST_F(GnuLdParserTest, DefsymMisssingSymbol) {
>> + EXPECT_FALSE(
>> + parse("ld", "--start-group", "--end-group", "--defsym==0",
>> nullptr));
>> +}
>> +
>> +TEST_F(GnuLdParserTest, DefsymMisssingValue) {
>> + EXPECT_FALSE(
>> + parse("ld", "--start-group", "--end-group", "--defsym=sym=",
>> nullptr));
>> +}
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>>
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
> by the Linux Foundation
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140404/d02247f9/attachment.html>
More information about the llvm-commits
mailing list