Re: addr2line seems to be off by one

2016-07-18 Thread Albert Netymk
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  wrote:
> On Sat, Jul 16, 2016 at 09:06:10PM +0200, Albert Netymk wrote:
>> == addr.c
>>
>> ```
>> #include 
>>
>> 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 
>>   40055b:   48 bf 04 06 40 00 00movabs $0x400604,%rdi
>>   400562:   00 00 00
>>   400565:   e8 a6 fe ff ff  callq  400410 
>> ```
>> `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


[Bug ld/20376] Possible address calculation overflow

2016-07-18 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20376

--- Comment #3 from H.J. Lu  ---
Created attachment 9399
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9399&action=edit
Try this

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20376] Possible address calculation overflow

2016-07-18 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20376

H.J. Lu  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |INVALID

--- Comment #4 from H.J. Lu  ---
Please -add "-m elf_i386".  Otherwise, you get the 2MB page.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils