NetBSD-Bugs archive

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

lib/39959: ld.elf_so breaks old perl



>Number:         39959
>Category:       lib
>Synopsis:       ld.elf_so doesn't work with old perl
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 19 21:40:00 +0000 2008
>Originator:     Brian Marcotte
>Release:        NetBSD 5.0_BETA
>Organization:
        panix.com
>Environment:
System: NetBSD panix5.panix.com 5.0_BETA NetBSD 5.0_BETA (PANIX-XEN3U-USER) #0: 
Wed Nov 12 09:29:45 EST 2008 
root%juggler.panix.com@localhost:/misc1/obj/misc2/devel/netbsd/5-beta/src/sys/arch/i386/compile/PANIX-XEN3U-USER
 i386
Architecture: i386
Machine: i386
>Description:
The ld.elf_so which comes with NetBSD 5 causes an old perl to fail with
this program:

        use Socket;

The perl is 5.6.1 compiled under NetBSD 1.5. Under the stock ld.elf_so,
this happens:

        Invalid shared object handle 0x1
        Can't find 'boot_Socket' symbol in
        /pkg/perl-5.6.1-elf/lib/perl-5.6.1/i386-netbsd/auto/Socket/Socket.so
        at /pkg/perl-5.6.1-elf/lib/perl-5.6.1/i386-netbsd/Socket.pm line 451
        Compilation failed in require at -e line 1.
        BEGIN failed--compilation aborted at -e line 1.

I have tracked this down to a change which happened on Jun 4, 2008:

        diff -u ld.so.2008060?/src/libexec/ld.elf_so/rtld.h
        --- 3/src/libexec/ld.elf_so/rtld.h 2008-01-14 03:52:16.000000000 -0500
        +++ 4/src/libexec/ld.elf_so/rtld.h 2008-06-03 15:32:32.000000000 -0400
        @@ -1,4 +1,4 @@
        -/*     $NetBSD: rtld.h,v 1.77 2008/01/14 08:52:16 yamt Exp $    */
        +/*     $NetBSD: rtld.h,v 1.78 2008/06/03 19:32:32 ad Exp $      */

         /*
          * Copyright 1996 John D. Polstra.
        @@ -130,6 +130,7 @@
                caddr_t         entry;          /* Entry point */
                const Elf_Phdr *__junk001;
                size_t          pathlen;        /* Pathname length */
        +       void            *ehdr;

                /* Items from the dynamic section. */
                Elf_Addr       *pltgot;         /* PLTGOT table */

Even without the other changes that happened on that day, this one change
causes the perl to fail.

Before and after ktrace output is at the location below.

>How-To-Repeat:
I have the old perl packaged up here along with the patch I used and the
ktrace output:

        http://www.panix.com/~marcotte/ld.elf_so/

It should fail with just "use Socket".

>Fix:
I made it work by moving the new variable to the bottom of the structure.

I don't, however, understand the real problem or why this appears to fix
it.



Home | Main Index | Thread Index | Old Index