[Bug binutils/11582] BFD structure linkage is broken
--- Additional Comments From dzidzitop at lavabit dot com 2010-05-14 07:07 --- Objdump uses special API functions which uses internal (properly linked data structures). The data structures which are claimed to be binary-format-independent are linked wrong. If my code is wrong please point out the exact line where it is wrong before closing this bug report as invalid. -- What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID | http://sourceware.org/bugzilla/show_bug.cgi?id=11582 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11582] BFD structure linkage is broken
--- Additional Comments From dzidzitop at lavabit dot com 2010-05-10 10:21 --- Where is that "silly error"? -- What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID | http://sourceware.org/bugzilla/show_bug.cgi?id=11582 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11582] BFD structure linkage is broken
--- Additional Comments From dzidzitop at lavabit dot com 2010-05-08 16:52 --- Created an attachment (id=4775) --> (http://sourceware.org/bugzilla/attachment.cgi?id=4775&action=view) A program that demonstates the bug A program that demonstates that 1) many bfd sections have zero (or wrong) offsets 2) many asymbol->section offsets do not have correspondent sections within the bfd structure -- http://sourceware.org/bugzilla/show_bug.cgi?id=11582 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11582] BFD structure linkage is broken
--- Additional Comments From dzidzitop at lavabit dot com 2010-05-08 16:49 --- Created an attachment (id=4774) --> (http://sourceware.org/bugzilla/attachment.cgi?id=4774&action=view) an C++ ELF binary which main.cpp could be tested on -- http://sourceware.org/bugzilla/show_bug.cgi?id=11582 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11582] New: BFD structure linkage is broken
BFD does not link bfd and asymbol structures properly. This is re-producible at least for GCC 4.4.0 under WinXP32 and Ubuntu 32-bit (9x version). The given program displays that: 1) many sections have zero (or very small like 0x1c) offset 2) the offsets of bfd->sections do not match to the offsets of (asymbol*)->section This does not allow users of BFD to match bfd sections to asymbol sections. -- Summary: BFD structure linkage is broken Product: binutils Version: 2.21 (HEAD) Status: NEW Severity: normal Priority: P2 Component: binutils AssignedTo: unassigned at sources dot redhat dot com ReportedBy: dzidzitop at lavabit dot com CC: bug-binutils at gnu dot org GCC build triplet: Mingw4.4.0/WinXP32/PE; GCC4.4.0/Ubuntu 32bit/ELF GCC host triplet: Mingw4.4.0/WinXP32/PE; GCC4.4.0/Ubuntu 32bit/ELF GCC target triplet: Mingw4.4.0/WinXP32/PE; GCC4.4.0/Ubuntu 32bit/ELF http://sourceware.org/bugzilla/show_bug.cgi?id=11582 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11513] Garbage is loaded into asection#lineno
--- Additional Comments From dzidzitop at lavabit dot com 2010-05-01 08:03 --- Created an attachment (id=4760) --> (http://sourceware.org/bugzilla/attachment.cgi?id=4760&action=view) The binary compiled with MinGW 4.4.0 without the -gcoff option. If the binary is compiled without -gcoff (MinGW 4.4.0) then no line information is available at all for this specific binary. -- http://sourceware.org/bugzilla/show_bug.cgi?id=11513 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11513] Garbage is loaded into asection#lineno
--- Additional Comments From dzidzitop at lavabit dot com 2010-05-01 08:00 --- In addition, there should be much more lineno entries once standard library is used. This information is available for GDB but BFD does not provide it via the alent structure -- http://sourceware.org/bugzilla/show_bug.cgi?id=11513 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11513] Garbage is loaded into asection#lineno
--- Additional Comments From dzidzitop at lavabit dot com 2010-04-30 20:09 --- Created an attachment (id=4758) --> (http://sourceware.org/bugzilla/attachment.cgi?id=4758&action=view) testcase to re-produce the issue compile this source (specify proper path in the PATH_TO_EXECUTABLE constant and run against bbb.exe. You will see offsets > 1000 which is simply wrong. bbb.exe was built from main.cpp which has lines > 40. There are no lines with such numbers displayed. For more complicated binaries line numbers are random. The binary is too large to upload it here to demonstate. There is also a question. Why sections within BFD are initialised if and only if bfd_check_format_matches(abfd, bfd_object, &matching) is called? This looks like a hack. -- http://sourceware.org/bugzilla/show_bug.cgi?id=11513 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11513] Garbage is loaded into asection#lineno
--- Additional Comments From dzidzitop at lavabit dot com 2010-04-30 20:10 --- Created an attachment (id=4759) --> (http://sourceware.org/bugzilla/attachment.cgi?id=4759&action=view) the binary to test on The binary was compiled and linked as follows: g++ -O0 -g3 -gcoff -Wall -c -fmessage-length=0 -omain.o ..\main.cpp g++ -obbb.exe main.o -lbfd -lintl -liberty -- http://sourceware.org/bugzilla/show_bug.cgi?id=11513 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11527] addr2line does not display correct function name/filename/line for __libc_start_main (Linux/ELF)
--- Additional Comments From dzidzitop at lavabit dot com 2010-04-22 20:56 --- Ok, probably just by analysing the executable statically (i.e. when it is not loaded into the memory) it is impossible to resolve dynamically linked functions: no section is actually created for them within the executable. -- What|Removed |Added Status|REOPENED|RESOLVED Resolution||INVALID http://sourceware.org/bugzilla/show_bug.cgi?id=11527 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11527] addr2line does not display correct function name/filename/line for __libc_start_main (Linux/ELF)
--- Additional Comments From dzidzitop at lavabit dot com 2010-04-22 18:45 --- Ah, ddd is the name of the executable. __libc_start_main could be found within the binary with ease. Dunno what is nm, but simple search for __libc_start_main in text editor returns something. -- http://sourceware.org/bugzilla/show_bug.cgi?id=11527 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11527] addr2line does not display correct function name/filename/line for __libc_start_main (Linux/ELF)
--- Additional Comments From dzidzitop at lavabit dot com 2010-04-22 18:42 --- What is ddd? And why backtrace_symbols correctly recognises the function? -- What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID | http://sourceware.org/bugzilla/show_bug.cgi?id=11527 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11527] addr2line does not display correct function name/filename/line for __libc_start_main (Linux/ELF)
--- Additional Comments From dzidzitop at lavabit dot com 2010-04-22 13:02 --- Created an attachment (id=4747) --> (http://sourceware.org/bugzilla/attachment.cgi?id=4747&action=view) executable which re-produces the bug -- http://sourceware.org/bugzilla/show_bug.cgi?id=11527 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11527] New: addr2line does not display correct function name/filename/line for __libc_start_main (Linux/ELF)
The application attached displays stacktrace of itself using execinfo.h tool contributed with linux. /home/liauchuk/projects/ddd/Debug/ddd [0x8048634] /home/liauchuk/projects/ddd/Debug/ddd [0x8048602] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0x21fb56] /home/liauchuk/projects/ddd/Debug/ddd [0x8048561] addr2line info: liauc...@liauchuk:~/projects/ddd/Debug$ addr2line -e ./ddd -f 0x21fb56 ?? ??:0 As it is visible, addr2line is not able to display proper information for the __libc_start_main function despite of this information is available within DEBUG info from the binary. Also, looking at the internal BFD structures built from the binary, I've found the the symbol element for this function is probably inconsistent. It's name attribute contains "__libc_start_main@@GLIBC_2.0" and the bfd_get_section_vma(abfd, symbol->section); returns zero as the starting address for the section which this symbol belongs to. This could be a possible cause of the problem -- Summary: addr2line does not display correct function name/filename/line for __libc_start_main (Linux/ELF) Product: binutils Version: 2.21 (HEAD) Status: NEW Severity: minor Priority: P2 Component: binutils AssignedTo: unassigned at sources dot redhat dot com ReportedBy: dzidzitop at lavabit dot com CC: bug-binutils at gnu dot org GCC host triplet: Linux2.6/GCC4.4.0 GCC target triplet: Linux2.6/GCC4.4.0/ELF http://sourceware.org/bugzilla/show_bug.cgi?id=11527 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11512] addr2line displays frong filename for GCC app compiled with -gcoff option
--- Additional Comments From dzidzitop at lavabit dot com 2010-04-21 12:46 --- By the way ! && offset + sec_vma >= file_addr ! && offset + sec_vma - file_addr <= maxdiff) This code from your patch. It could be re-written to store offset + sec_vma - file_addr into a variable, say x, and then check for x >= 0 && x <= maxdiff. It is unsufficient, but anyway :) -- http://sourceware.org/bugzilla/show_bug.cgi?id=11512 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11512] addr2line displays frong filename for GCC app compiled with -gcoff option
--- Additional Comments From dzidzitop at lavabit dot com 2010-04-21 12:36 --- Good job Nick. This works for me, at least under Ubuntu. Thanks. -- What|Removed |Added Status|WAITING |RESOLVED Resolution||WORKSFORME http://sourceware.org/bugzilla/show_bug.cgi?id=11512 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11512] addr2line displays frong filename for GCC app compiled with -gcoff option
-- What|Removed |Added Attachment #4742|A file to demonstrate the |A file to demonstrate the description|bug |bug (the name of the file ||displayed by addr2line ||should be bbb.cpp) http://sourceware.org/bugzilla/show_bug.cgi?id=11512 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11512] addr2line displays frong filename for GCC app compiled with -gcoff option
--- Additional Comments From dzidzitop at lavabit dot com 2010-04-20 18:08 --- Created an attachment (id=4742) --> (http://sourceware.org/bugzilla/attachment.cgi?id=4742&action=view) A file to demonstrate the bug -- http://sourceware.org/bugzilla/show_bug.cgi?id=11512 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11512] addr2line displays frong filename for GCC app compiled with -gcoff option
-- What|Removed |Added Attachment #4741 is|0 |1 obsolete|| http://sourceware.org/bugzilla/show_bug.cgi?id=11512 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11512] addr2line displays frong filename for GCC app compiled with -gcoff option
--- Additional Comments From dzidzitop at lavabit dot com 2010-04-20 18:05 --- Created an attachment (id=4741) --> (http://sourceware.org/bugzilla/attachment.cgi?id=4741&action=view) A file to demonstrate the bug Forget about previous application. It is too large to be sumbited here. Attached is a tiny program with itself displays the address of a function f(). It is: 004013C0 When I use addr2line to obtain the filename and the line number for it I get: C:\Projects\AFC\bbb\Debug>addr2line -e bbb.exe 0x004013C0 cygming-crtend.c:0 -- http://sourceware.org/bugzilla/show_bug.cgi?id=11512 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11512] addr2line displays frong filename for GCC app compiled with -gcoff option
--- Additional Comments From dzidzitop at lavabit dot com 2010-04-20 17:32 --- Thanks Nick, but the patch is unlikely to help. The bug is in the other binutils program - addr2line. This patch changes something within the objdump program. Actually, the bug is somewhere inside the BFD library. I see now how to create attachments here. I will submit the executable with reveals the bug. Addresses to test the behaviour of the addr2line are in the list below (function names are obtained by means of custom manipulating with BFD): afc::backtrace(void**, unsigned int) <0x402c97> at dyncast.cc:491 afc::StackTrace::StackTrace() <0x402e92>at dyncast.cc:527 f() <0x401613> at dyncast.cc:23 g() <0x401675> at dyncast.cc:30 main <0x4016f8> at dyncast.cc:34 _onexit <0x4010db> at dyncast.cc mainCRTStartup <0x401178> at dyncast.cc <0x7c817077> at Correct file names contain stack_trace_win32.cpp and StackTrace.cpp in the path. -- What|Removed |Added Status|WAITING |NEW http://sourceware.org/bugzilla/show_bug.cgi?id=11512 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11513] Garbage is loaded into asection#lineno
-- What|Removed |Added GCC host triplet||WinXP 32bit GCC target triplet||WinXP 32bit PE http://sourceware.org/bugzilla/show_bug.cgi?id=11513 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11512] addr2line displays frong filename for GCC app compiled with -gcoff option
-- What|Removed |Added GCC host triplet||WinXP 32bit GCC target triplet||WinXP 32bit PE http://sourceware.org/bugzilla/show_bug.cgi?id=11512 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11513] New: Garbage is loaded into asection#lineno
For dward and coff symbol tables (generated by MinGW 4.4.0) the BFD library loads garbage into the symbol table into asymbol#lineno array. For instance, 30701 as a line_number and 0 as an offset (or symbol pointer). This happens for any program. In addition, there is no way to distinguish when alent.u.sym should be used and when alent.u.offset. Symtable initialisation code (for already initialised abfd): static void slurp_symtab(bfd* const abfd) { long storage; bool dynamic = false; if ((bfd_get_file_flags(abfd) & HAS_SYMS) == 0) { return; } storage = bfd_get_symtab_upper_bound(abfd); if (storage == 0) { storage = bfd_get_dynamic_symtab_upper_bound(abfd); dynamic = false; } if (storage < 0) { //bfd_fatal (bfd_get_filename (abfd)); } syms = (asymbol**) malloc(storage); if (dynamic) { symCount = bfd_canonicalize_dynamic_symtab(abfd, syms); } else { symCount = bfd_canonicalize_symtab(abfd, syms); } if (symCount < 0) { //bfd_fatal (bfd_get_filename (abfd)); } } -- Summary: Garbage is loaded into asection#lineno Product: binutils Version: 2.21 (HEAD) Status: NEW Severity: normal Priority: P2 Component: binutils AssignedTo: unassigned at sources dot redhat dot com ReportedBy: dzidzitop at lavabit dot com CC: bug-binutils at gnu dot org http://sourceware.org/bugzilla/show_bug.cgi?id=11513 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/11512] New: addr2line displays frong filename for GCC app compiled with -gcoff option
addr2line displays frong filename for an app compiled with -gcoff option (MinGW 4.4.0). In particular, it displays dyncast.cc as a filename instead of StackTrace.cpp. If the application is compiled without -gcoff the correct filename is displayed. -- Summary: addr2line displays frong filename for GCC app compiled with -gcoff option Product: binutils Version: 2.21 (HEAD) Status: NEW Severity: normal Priority: P2 Component: binutils AssignedTo: unassigned at sources dot redhat dot com ReportedBy: dzidzitop at lavabit dot com CC: bug-binutils at gnu dot org http://sourceware.org/bugzilla/show_bug.cgi?id=11512 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils