<div dir="ltr">I think the gdb-index support in lld only works with debug_gnu_pubnames in the input files - so you would need to compile with -ggnu-pubnames.<br><br>Maybe lld could/should have a warning or something if the input files have debug_* sections but don't have debug_gnu_pubnames when -Wl,--gdb-index is specified.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 27, 2021 at 9:52 AM 何文婷 via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="line-height:1.7;color:rgb(0,0,0);font-size:14px;font-family:Arial"><pre style="width:1044.05px">Hi all,
    I am using below command to generate my object file named `myelf`:
    `clang++-10 -Wl,--dynamic-linker,/lib64/ld-linux-x86-64.so.2 -fuse-ld=/.../usr/bin/ld.lld -rdynamic -Wl,—gdb-index -o myelf xxx.a xxx.a xxx.a`
    I found when link with -gdb-index option, it will generate the section of .gdb_index in my elf file named myelf. But this gdb_index section is not full, and when I gdb myelf to print some function like `abc` , it shows that no symbol found(.gdb_index section donot have the function abc, but .debug_full and .symtab has this function).
    But When  I am using clang++ compile without gdb-index option  and then  using `gdb-add-index myelf `command to add gdb-index section, this section is much larger, and When I gdb to print some function, all the symbols can be found.
<div>    I do not understand, why lld generate a smaller .gdb_index section, and is there any options to let me generate full .gdb_index section?</div><div><br></div><div>    Waiting for some advices.</div><div><br></div><div>Best wishes.</div><div>hexiaoting</div><div>2020.2.25</div><div><br></div></pre></div><br><br><span title="neteasefooter"><p> </p></span>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>