Yes, you are right. Reported to clang: https://llvm.org/bugs/show_bug.cgi?id=28596
Thank you very much. On Mon, Jul 18, 2016 at 3:40 AM, Alan Modra <amo...@gmail.com> wrote: > On Sat, Jul 16, 2016 at 09:06:10PM +0200, Albert Netymk wrote: >> == addr.c >> >> ``` >> #include <stdio.h> >> >> void f() { } >> >> int main(int argc, char **argv) >> { >> f(); >> puts("done"); >> return 0; >> } >> ``` >> >> ``` >> $ clang -g addr.c ; objdump -d a.out | grep -B 3 puts | tail -n 4 >> 400556: e8 d5 ff ff ff callq 400530 <f> >> 40055b: 48 bf 04 06 40 00 00 movabs $0x400604,%rdi >> 400562: 00 00 00 >> 400565: e8 a6 fe ff ff callq 400410 <puts@plt> >> ``` >> `40055b` is corresponding to placing "done" in `%rdi`, so I expect it >> to be associated to line of `puts("done")`. However, `addr2line >> 40055b` shows the line of `f()`. >> >> >> == ENV >> >> clang: clang version 3.8.1-svn271230-1~exp1 (branches/release_38) >> addr2line: GNU addr2line (GNU Binutils for Ubuntu) 2.24 > > Please dump out the raw line number information produced by clang, > using "readelf -wl a.out". I think you will find that the problem is > with clang, not addr2line. > > -- > Alan Modra > Australia Development Lab, IBM -- Best Regards Yours faithfully Albert Netymk _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils