bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Null pointer read in binutils-2.10.0.33: bfd/elf32-i386.c: elf_i386_relo


From: Marco Franzen
Subject: Null pointer read in binutils-2.10.0.33: bfd/elf32-i386.c: elf_i386_relocate_section
Date: Thu, 22 Mar 2001 19:47:50 +0000

My platform is a GNU/Linux distribution for IA32, SuSE 7.0 
(gcc 2.95.2, glibc 2.1.3).
That system normally comes with binutils-2.9.5, but because the linker crashed,
I gave 2.10.0.33 a try (the source package that comes with SuSE 7.1), 
which crashes the same way.

Unfortunately, I cannot send input files, as Oracle would not allow that.
Here is a short debugger session (sorry for the long lines).

GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-suse-linux"...
(gdb) run -v -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o cpp.e 
/usr/lib/crt1.o /usr/lib/crti.o 
/usr/lib/gcc-lib/i486-suse-linux/2.95.2/crtbegin.o 
-L/opt/oracle/product/8.1.6/lib/ -L/usr/lib/gcc-lib/i486-suse-linux/2.95.2 
-L/usr/i486-suse-linux/lib cpp.o 
/home/marcof/YES.pay/yes_products/yes_base/source/library/database_lib/lib_yesdb.a
 /home/marcof/YES.pay/yes_products/yes_base/source/library/task_lib/libtask.a 
-lncurses -lclntsh -ldl -lm -lpthread -ldl -lm 
/home/marcof/YES.pay/yes_products/yesroot_base/yes.gate_root/yes.gate_libs/libyesgate_gen.a
 
/home/marcof/YES.pay/yes_products/yesroot_base/yes.gate_root/yes.gate_libs/libschenh.a
 
/home/marcof/YES.pay/yes_products/yesroot_base/yes.gate_root/yes.gate_libs/libdebug.a
 -lgcc -lc -lgcc /usr/lib/gcc-lib/i486-suse-linux/2.95.2/crtend.o 
/usr/lib/crtn.o
Starting program: /usr/bin/ld -v -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 
-o cpp.e /usr/lib/crt1.o /usr/lib/crti.o 
/usr/lib/gcc-lib/i486-suse-linux/2.95.2/crtbegin.o 
-L/opt/oracle/product/8.1.6/lib/ -L/usr/lib/gcc-lib/i486-suse-linux/2.95.2 
-L/usr/i486-suse-linux/lib cpp.o 
/home/marcof/YES.pay/yes_products/yes_base/source/library/database_lib/lib_yesdb.a
 /home/marcof/YES.pay/yes_products/yes_base/source/library/task_lib/libtask.a 
-lncurses -lclntsh -ldl -lm -lpthread -ldl -lm 
/home/marcof/YES.pay/yes_products/yesroot_base/yes.gate_root/yes.gate_libs/libyesgate_gen.a
 
/home/marcof/YES.pay/yes_products/yesroot_base/yes.gate_root/yes.gate_libs/libschenh.a
 
/home/marcof/YES.pay/yes_products/yesroot_base/yes.gate_root/yes.gate_libs/libdebug.a
 -lgcc -lc -lgcc /usr/lib/gcc-lib/i486-suse-linux/2.95.2/crtend.o 
/usr/lib/crtn.o
GNU ld version 2.10.91 (with BFD 2.10.0.33)

Program received signal SIGSEGV, Segmentation fault.
0x8075957 in elf_i386_relocate_section (output_bfd=0x80ee580, info=0x80e6800, 
    input_bfd=0x812b788, input_section=0x8138e64, contents=0x83abe08 "", 
    relocs=0x83c4638, local_syms=0x82ba550, local_sections=0x82ba738)
    at elf32-i386.c:1389
1389              h = sym_hashes[r_symndx - symtab_hdr->sh_info];
(gdb) print sym_hashes[r_symndx - symtab_hdr->sh_info]
Cannot access memory at address 0x2c.
(gdb) print sym_hashes
$4 = (struct elf_link_hash_entry **) 0x0
(gdb) print r_symndx
$5 = 16
(gdb) print symtab_hdr 
$2 = (Elf_Internal_Shdr *) 0x81388e8
(gdb) print symtab_hdr->sh_info
$3 = 5
(gdb) list
1384                            + sec->output_offset
1385                            + sym->st_value);
1386            }
1387          else
1388            {
1389              h = sym_hashes[r_symndx - symtab_hdr->sh_info];  /*<---here*/
1390              while (h->root.type == bfd_link_hash_indirect
1391                     || h->root.type == bfd_link_hash_warning)
1392                h = (struct elf_link_hash_entry *) h->root.u.i.link;
1393              if (h->root.type == bfd_link_hash_defined
(gdb) 

The only slightly unusual thing about the files being linked is 
that functions in a (.a) library make calls to functions (by name) that 
are defined in the main module. 
(No idea what the Oracle library -lclntsh and the pre-compiled 
esql does or whether they contribute to the problem at all.)

Any tip how to locate the problem or any workarounds?

Cheers,

Marco
-----------------------------------------------------------------
This email is confidential and intended solely for the use of the
individual to whom it is addressed.
Any views or opinions presented are solely those of the author
and do not necessarily represent those of Thyron Limited.
If you are not the intended recipient then please be advised
that you have received this email in error and that any use,
dissemination, forwarding, printing or copying of this email 
is strictly prohibited.
If you have received this email in error, please notify the 
Thyron IT Administrator on +44 (0)1923 236 050 or 
send an email to address@hidden
Thank You



reply via email to

[Prev in Thread] Current Thread [Next in Thread]