<div dir="ltr">Sorry, might've been a bit imprecise.<br><br>Simple object files start with one CU in the debug_info section and one debug_gnu_pubnames section - my concern was that the pubnames section might not specify which CU it's about. My mistake though, it does. So ld -r'ing two objects together, creating one gnu_pubnames section with the two chunks of pubnames from the two input object files is fine - because the chunks specify which CU they correspond to - there's no information loss there.<br><br>I mean, if you went far and ld -r half your objects together, you're going to have huge pubnames sections and you might wish that your linker had produced a fancy, faster, more compact index in that object file - but I don't think that's really a problem we need to solve today (or until someone really decides that's an important scenario for them).</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 24, 2018 at 10:32 AM Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 23, 2018 at 5:03 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 18, 2018 at 3:03 PM Fangrui Song via Phabricator via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">MaskRay updated this revision to Diff 156160.<br>
MaskRay added a comment.<br>
<br>
.<br>
<br>
<br>
Repository:<br>
  rLLD LLVM Linker<br>
<br>
<a href="https://reviews.llvm.org/D49513" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49513</a><br>
<br>
Files:<br>
  ELF/Driver.cpp<br>
  test/ELF/driver.test<br>
<br>
<br>
Index: test/ELF/driver.test<br>
===================================================================<br>
--- test/ELF/driver.test<br>
+++ test/ELF/driver.test<br>
@@ -35,31 +35,35 @@<br>
 # RUN: not ld.lld -r --gc-sections %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR3 %s<br>
 # ERR3: -r and --gc-sections may not be used together<br>
<br>
+## Attempt to use -r and --gdb-index together<br>
+# RUN: not ld.lld -r --gdb-index %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR4 %s<br>
+# ERR4: -r and --gdb-index may not be used together<br>
+<br>
 ## Attempt to use -r and --icf together<br>
-# RUN: not ld.lld -r --icf=all %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR4 %s<br>
-# ERR4: -r and --icf may not be used together<br>
+# RUN: not ld.lld -r --icf=all %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR5 %s<br>
+# ERR5: -r and --icf may not be used together<br>
<br>
 ## Attempt to use -r and -pie together<br>
-# RUN: not ld.lld -r -pie %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR5 %s<br>
-# ERR5: -r and -pie may not be used together<br>
+# RUN: not ld.lld -r -pie %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR6 %s<br>
+# ERR6: -r and -pie may not be used together<br>
<br>
 ## Attempt to use -shared and -pie together<br>
-# RUN: not ld.lld -shared -pie %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR6 %s<br>
-# ERR6: -shared and -pie may not be used together<br>
+# RUN: not ld.lld -shared -pie %t -o %tfail 2>&1 | FileCheck -check-prefix=ERR7 %s<br>
+# ERR7: -shared and -pie may not be used together<br>
<br>
 ## "--output=foo" is equivalent to "-o foo".<br>
-# RUN: not ld.lld %t --output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR7 %s<br>
-# ERR7: cannot open output file /no/such/file<br>
+# RUN: not ld.lld %t --output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR8 %s<br>
+# ERR8: cannot open output file /no/such/file<br>
<br>
 ## "-output=foo" is equivalent to "-o utput=foo".<br>
-# RUN: not ld.lld %t -output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR8 %s<br>
-# ERR8: cannot open output file utput=/no/such/file<br>
+# RUN: not ld.lld %t -output=/no/such/file 2>&1 | FileCheck -check-prefix=ERR9 %s<br>
+# ERR9: cannot open output file utput=/no/such/file<br>
<br>
-# RUN: not ld.lld %t -z foo 2>&1 | FileCheck -check-prefix=ERR9 %s<br>
-# ERR9: unknown -z value: foo<br>
+# RUN: not ld.lld %t -z foo 2>&1 | FileCheck -check-prefix=ERR10 %s<br>
+# ERR10: unknown -z value: foo<br>
<br>
-# RUN: not ld.lld %t -z max-page-size 2>&1 | FileCheck -check-prefix=ERR10 %s<br>
-# ERR10: unknown -z value: max-page-size<br>
+# RUN: not ld.lld %t -z max-page-size 2>&1 | FileCheck -check-prefix=ERR11 %s<br>
+# ERR11: unknown -z value: max-page-size<br>
<br>
 .globl _start<br>
 _start:<br>
Index: ELF/Driver.cpp<br>
===================================================================<br>
--- ELF/Driver.cpp<br>
+++ ELF/Driver.cpp<br>
@@ -294,6 +294,8 @@<br>
       error("-r and -shared may not be used together");<br>
     if (Config->GcSections)<br>
       error("-r and --gc-sections may not be used together");<br>
+    if (Config->GdbIndex)<br>
+      error("-r and --gdb-index may not be used together");<br>
     if (Config->ICF)<br>
       error("-r and --icf may not be used together");<br>
     if (Config->Pie)<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>