Re: gas SEGV reporting an error + patch

2006-07-17 Thread Alan Modra
On Tue, Jul 11, 2006 at 03:30:16PM -0400, Mat Hostetter wrote:
> The bug is that 'report_op_error' incorrectly uses 'file' and 'line'
> in the 'else' case where they are not initialized. Because the value
> of 'file' is garbage, it is of course somewhat random whether you will
> see a crash.
> 
> The fix is trivial: since there is no location information available,
> use 'as_bad' instead of 'as_bad_where', as it was already doing for
> other errors in the 'else' case.

Applied.  Thanks!

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


addr2line reports wrong line number for abort(), gdb reports correctly

2006-07-17 Thread Sam Roberts

I'm trying to use the addr2line source as an example of using bfd to map the
addresses from the glibc backtrace() back to file and line number. In the
process I realized that addr2line doesn't report the correct address.

This seems like a bug.

gdb reports:
(gdb) bt
#0  0xe410 in __kernel_vsyscall ()
#1  0xb7e989a1 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7e9a2b9 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0x0804836b in level_aa () at ab.c:5
#4  0x0804838c in main () at ab.c:10

addr2line:

% addr2line -e ab 0x0804836b
/home/sroberts/s/segv/ab.c:9

% cat ab.c
#include 

void level_aa()
{
abort(); /* <- this is line 5, gdb is correct */
}

int main()
{
level_aa();
return 0;
}

compiled with:

% gcc -o ab -g ab.c

% /usr/bin/addr2line --version
GNU addr2line 2.16.91 20060118 Debian GNU/Linux

% uname -a
Linux pebble.bycast.com 2.6.15-25-386 #1 PREEMPT Wed Jun 14 11:25:49 UTC 2006 
i686 GNU/Linux

% cat /etc/issue
Ubuntu 6.06 LTS \n \l

% gcc --version
gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

% gdb --version
GNU gdb 6.4-debian
This GDB was configured as "i486-linux-gnu".

Thanks,
Sam



___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/2939] New: ld --cref doesn't work with --as-needed

2006-07-17 Thread hjl at lucon dot org
--cref was broken by --as-needed. cref stores the string pointer from
a dso. When memory of unused dso is freed, cref reference is corrupted.

-- 
   Summary: ld --cref doesn't work with --as-needed
   Product: binutils
   Version: 2.18 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: hjl at lucon dot org
CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=2939

--- 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 ld/2939] ld --cref doesn't work with --as-needed

2006-07-17 Thread hjl at lucon dot org

--- Additional Comments From hjl at lucon dot org  2006-07-17 22:51 ---
Created an attachment (id=1171)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=1171&action=view)
A testcase

I got

[EMAIL PROTECTED] cref]$ make
gcc -fPIC   -c -o x.o x.c
gcc -fPIC   -c -o y.o y.c
./ld -shared -o liby.so y.o
./ld --cref -shared -o libx1.so x.o -L. \
--as-needed -ly --no-as-needed

Cross Reference Table

SymbolFile
_DYNAMIC  x.o
_GLOBAL_OFFSET_TABLE_ x.o
__bss_start   ./liby.so
_edata./liby.so
_end  ./liby.so
_startx.o
./ld: symbol `bar' missing from main hash table
bar   ./liby.so
./ld --cref -shared -o libx2.so x.o -L. -ly

Cross Reference Table

SymbolFile
_DYNAMIC  x.o
_GLOBAL_OFFSET_TABLE_ x.o
__bss_start   ./liby.so
_edata./liby.so
_end  ./liby.so
_startx.o
[EMAIL PROTECTED] cref]$

The error is

./ld: symbol `bar' missing from main hash table

since bar has been freed because liby.so isn't needed. 

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2939

--- 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 ld/2939] ld --cref doesn't work with --as-needed

2006-07-17 Thread amodra at bigpond dot net dot au


-- 
   What|Removed |Added

 AssignedTo|unassigned at sources dot   |amodra at bigpond dot net
   |redhat dot com  |dot au


http://sourceware.org/bugzilla/show_bug.cgi?id=2939

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