[llvm-dev] Some questions about lld with gdb-index option

何文婷 via llvm-dev llvm-dev at lists.llvm.org
Wed Feb 24 18:14:48 PST 2021


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.
    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?

    Waiting for some advices.


Best wishes.
hexiaoting
2020.2.25

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210225/d7043a47/attachment-0001.html>


More information about the llvm-dev mailing list