gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] RE ld from 2.14.90.0.8 puts no value into undefined symbols


From: Peter Wood
Subject: [Gcl-devel] RE ld from 2.14.90.0.8 puts no value into undefined symbols
Date: Fri, 27 Feb 2004 13:07:00 +0100
User-agent: Mutt/1.4i

Hi Camm

I think it's a bug in BFD.  In a binutils downloaded via CVS today, in
src/bfd/elf32-i386.c

#define elf_backend_want_plt_sym    1 /* was 0, breaks GCL -prw */

_Seems_ to fix this for me on a binutils from CVS (today).

I tested it with the following file.  First with my old (system) ld,
(GNU ld version 2.13.2) then with the new ld _without_ the change,
then with the new ld _with_ the change (GNU ld version 2.15.90 20040227)

*disclaimer*

1) I haven't tested it with GCL, since I'm working with an _ancient_
version of GCL which is completely irrelevant to current development.

2) I have no idea why elf_backend_want_plt_sym was defined to 0, and I
don't know the full consequences of changing it.  Hopefully, it was
just an oversight and the BFD people won't mind changing it

Regards,
Peter

/* dynatest.c : to test availability of plt symbols in executable image */

#include <stdio.h>

int main (){

  unsigned long secs = 1000000;
  
  printf("Sleeping\n");
  usleep(secs);
  return(0);
}
/* end */

WITH OLD ld:   gcc -o dynatest dynatest.c

objdump -x dynatest | grep -e UND
080482f8       F *UND*  00000067              usleep@@GLIBC_2.0
08048308  w    F *UND*  00000048              __register_frame_info@@GLIBC_2.0
00000000         *UND*  00000004              _fp_hw
08048318  w    F *UND*  0000005e              __deregister_frame_info@@GLIBC_2.0
08048328       F *UND*  000000d5              __libc_start_main@@GLIBC_2.0
08048338       F *UND*  00000033              printf@@GLIBC_2.0
00000000  w      *UND*  00000000              __gmon_start__

==============================================
WITH NEW ld (bad for GCL)

/home/prw/binutils-1077869339/bin/ld -dy -o --dynamic-linker /lib/ld-linux-so2 
/lib/dynatest_new /usr/lib/crt1.o /usr/lib/crti.o 
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.3/crtbegin.o 
-L/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.3 dynatest.o -lgcc -lc -lgcc 
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.3/crtend.o /usr/lib/crtn.o 

objdump -x dynatest_new | grep -e UND

00000000       F *UND*  00000067              usleep@@GLIBC_2.0
08048308  w    F *UND*  00000048              __register_frame_info@@GLIBC_2.0
00000000         *UND*  00000004              _fp_hw
08048318  w    F *UND*  0000005e              __deregister_frame_info@@GLIBC_2.0
00000000       F *UND*  000000d5              __libc_start_main@@GLIBC_2.0
00000000       F *UND*  00000033              printf@@GLIBC_2.0
00000000  w      *UND*  00000000              __gmon_start__

===================================================
WITH NEW ld WITH change to bfd/elf32-i386.c in binutils from cvs

#define elf_backend_want_plt_sym        1 /* was 0, breaks GCL -prw */

/home/prw/binutils-1077880238/bin/ld -dy --dynamic-linker /lib/ld-linux.so.2 -o 
dynatest_new /usr/lib/crt1.o /usr/lib/crti.o 
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.3/crtbegin.o 
-L/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.3 dynatest.o -lgcc -lc -lgcc 
/usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.3/crtend.o /usr/lib/crtn.o 


objdump -x dynatest | grep -e UND
080482f8       F *UND*  00000067              usleep@@GLIBC_2.0
08048308  w    F *UND*  00000048              __register_frame_info@@GLIBC_2.0
00000000         *UND*  00000004              _fp_hw
08048318  w    F *UND*  0000005e              __deregister_frame_info@@GLIBC_2.0
08048328       F *UND*  000000d5              __libc_start_main@@GLIBC_2.0
08048338       F *UND*  00000033              printf@@GLIBC_2.0
00000000  w      *UND*  00000000              __gmon_start__

=============================================




reply via email to

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