[PATCH] D49513: [ELF] gdb-index: don't remove .debug_gnu_pub{names, types} in -r mode

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 24 10:32:21 PDT 2018


I believe lld recognizes only the first .gnu_pubnames section and ignore
other sections with the same name in the same object file, but I might be
wrong.

On Mon, Jul 23, 2018 at 5:03 PM David Blaikie <dblaikie at gmail.com> wrote:

> This might not be especially useful - the gnu_pubnames sections don't
> describe which CU they are for (if I recall correctly), so once you've got
> multiple CUs in a single object file (admittedly, this happens in LTO too,
> adn I'm not sure how that's handled) it might not be terribly useful. I'm
> not sure what lld's gdb-index does when consuming an object with multiple
> CUs in it, for example.
>
> On Wed, Jul 18, 2018 at 3:03 PM Fangrui Song via Phabricator via
> llvm-commits <llvm-commits at lists.llvm.org> wrote:
>
>> MaskRay updated this revision to Diff 156160.
>> MaskRay added a comment.
>>
>> .
>>
>>
>> Repository:
>>   rLLD LLVM Linker
>>
>> https://reviews.llvm.org/D49513
>>
>> Files:
>>   ELF/Driver.cpp
>>   test/ELF/driver.test
>>
>>
>> Index: test/ELF/driver.test
>> ===================================================================
>> --- test/ELF/driver.test
>> +++ test/ELF/driver.test
>> @@ -35,31 +35,35 @@
>>  # RUN: not ld.lld -r --gc-sections %t -o %tfail 2>&1 | FileCheck
>> -check-prefix=ERR3 %s
>>  # ERR3: -r and --gc-sections may not be used together
>>
>> +## Attempt to use -r and --gdb-index together
>> +# RUN: not ld.lld -r --gdb-index %t -o %tfail 2>&1 | FileCheck
>> -check-prefix=ERR4 %s
>> +# ERR4: -r and --gdb-index may not be used together
>> +
>>  ## Attempt to use -r and --icf together
>> -# RUN: not ld.lld -r --icf=all %t -o %tfail 2>&1 | FileCheck
>> -check-prefix=ERR4 %s
>> -# ERR4: -r and --icf may not be used together
>> +# RUN: not ld.lld -r --icf=all %t -o %tfail 2>&1 | FileCheck
>> -check-prefix=ERR5 %s
>> +# ERR5: -r and --icf may not be used together
>>
>>  ## Attempt to use -r and -pie together
>> -# RUN: not ld.lld -r -pie %t -o %tfail 2>&1 | FileCheck
>> -check-prefix=ERR5 %s
>> -# ERR5: -r and -pie may not be used together
>> +# RUN: not ld.lld -r -pie %t -o %tfail 2>&1 | FileCheck
>> -check-prefix=ERR6 %s
>> +# ERR6: -r and -pie may not be used together
>>
>>  ## Attempt to use -shared and -pie together
>> -# RUN: not ld.lld -shared -pie %t -o %tfail 2>&1 | FileCheck
>> -check-prefix=ERR6 %s
>> -# ERR6: -shared and -pie may not be used together
>> +# RUN: not ld.lld -shared -pie %t -o %tfail 2>&1 | FileCheck
>> -check-prefix=ERR7 %s
>> +# ERR7: -shared and -pie may not be used together
>>
>>  ## "--output=foo" is equivalent to "-o foo".
>> -# RUN: not ld.lld %t --output=/no/such/file 2>&1 | FileCheck
>> -check-prefix=ERR7 %s
>> -# ERR7: cannot open output file /no/such/file
>> +# RUN: not ld.lld %t --output=/no/such/file 2>&1 | FileCheck
>> -check-prefix=ERR8 %s
>> +# ERR8: cannot open output file /no/such/file
>>
>>  ## "-output=foo" is equivalent to "-o utput=foo".
>> -# RUN: not ld.lld %t -output=/no/such/file 2>&1 | FileCheck
>> -check-prefix=ERR8 %s
>> -# ERR8: cannot open output file utput=/no/such/file
>> +# RUN: not ld.lld %t -output=/no/such/file 2>&1 | FileCheck
>> -check-prefix=ERR9 %s
>> +# ERR9: cannot open output file utput=/no/such/file
>>
>> -# RUN: not ld.lld %t -z foo 2>&1 | FileCheck -check-prefix=ERR9 %s
>> -# ERR9: unknown -z value: foo
>> +# RUN: not ld.lld %t -z foo 2>&1 | FileCheck -check-prefix=ERR10 %s
>> +# ERR10: unknown -z value: foo
>>
>> -# RUN: not ld.lld %t -z max-page-size 2>&1 | FileCheck
>> -check-prefix=ERR10 %s
>> -# ERR10: unknown -z value: max-page-size
>> +# RUN: not ld.lld %t -z max-page-size 2>&1 | FileCheck
>> -check-prefix=ERR11 %s
>> +# ERR11: unknown -z value: max-page-size
>>
>>  .globl _start
>>  _start:
>> Index: ELF/Driver.cpp
>> ===================================================================
>> --- ELF/Driver.cpp
>> +++ ELF/Driver.cpp
>> @@ -294,6 +294,8 @@
>>        error("-r and -shared may not be used together");
>>      if (Config->GcSections)
>>        error("-r and --gc-sections may not be used together");
>> +    if (Config->GdbIndex)
>> +      error("-r and --gdb-index may not be used together");
>>      if (Config->ICF)
>>        error("-r and --icf may not be used together");
>>      if (Config->Pie)
>>
>>
>> _______________________________________________
>> 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/20180724/c1d6f02c/attachment-0001.html>


More information about the llvm-commits mailing list