[Bug binutils/11582] BFD structure linkage is broken

2010-05-14 Thread dzidzitop at lavabit dot com

--- 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] New: BFD structure linkage is broken

2010-05-08 Thread dzidzitop at lavabit dot com
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/11582] BFD structure linkage is broken

2010-05-08 Thread dzidzitop at lavabit dot com

--- 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=4774action=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] BFD structure linkage is broken

2010-05-08 Thread dzidzitop at lavabit dot com

--- 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=4775action=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/11513] Garbage is loaded into asection#lineno

2010-05-01 Thread dzidzitop at lavabit dot com

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

2010-05-01 Thread dzidzitop at lavabit dot com

--- 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=4760action=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

2010-04-30 Thread dzidzitop at lavabit dot com

--- 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=4759action=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/11513] Garbage is loaded into asection#lineno

2010-04-30 Thread dzidzitop at lavabit dot com

--- 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=4758action=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/11527] addr2line does not display correct function name/filename/line for __libc_start_main (Linux/ELF)

2010-04-22 Thread dzidzitop at lavabit dot com

--- 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=4747action=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] addr2line does not display correct function name/filename/line for __libc_start_main (Linux/ELF)

2010-04-22 Thread dzidzitop at lavabit dot com

--- 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)

2010-04-22 Thread dzidzitop at lavabit dot com

--- 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)

2010-04-22 Thread dzidzitop at lavabit dot com

--- 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/11512] addr2line displays frong filename for GCC app compiled with -gcoff option

2010-04-21 Thread dzidzitop at lavabit dot com

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

2010-04-21 Thread dzidzitop at lavabit dot com

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

2010-04-20 Thread dzidzitop at lavabit dot com

--- 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() 0x402e92at 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
unknown 0x7c817077  at unknown source

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/11512] addr2line displays frong filename for GCC app compiled with -gcoff option

2010-04-20 Thread dzidzitop at lavabit dot com

--- 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=4741action=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\Debugaddr2line -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

2010-04-20 Thread dzidzitop at lavabit dot com


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

2010-04-20 Thread dzidzitop at lavabit dot com

--- 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=4742action=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

2010-04-20 Thread dzidzitop at lavabit dot com


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

2010-04-19 Thread dzidzitop at lavabit dot com


-- 
   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] Garbage is loaded into asection#lineno

2010-04-19 Thread dzidzitop at lavabit dot com


-- 
   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] New: addr2line displays frong filename for GCC app compiled with -gcoff option

2010-04-18 Thread dzidzitop at lavabit dot com
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


[Bug binutils/11513] New: Garbage is loaded into asection#lineno

2010-04-18 Thread dzidzitop at lavabit dot com
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