Bug 1331 - Prelink: doesn't work on ppc64
Summary: Prelink: doesn't work on ppc64
Status: RESOLVED OBSOLETE
Alias: None
Product: Cross-prelink
Classification: Yocto Project Subprojects
Component: cross-prelink (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: Future
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
: 1531 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-04 11:08 UTC by Kumar Gala
Modified: 2022-02-11 20:33 UTC (History)
12 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kumar Gala 2011-08-04 11:08:23 UTC
We get a segfault and error when we try to utilize prelink on a core-image-minimal.

prelink: /lib64/libc.so.6: Recorded 1 dependencies, now seeing -1

in dmesg:

prelink-rtld[14492]: segfault at 289986a94 ip 0000000000408de2 sp 00007fff65ad3c10 error 4 in prelink-rtld[400000+e000]
Comment 1 Kumar Gala 2011-08-04 11:34:03 UTC
Here's output of running a native prelink (which works) on a 64-bit board:

root@p5020-ds:~# prelink --root / -amR -n -v -N -c  /etc/prelink.conf 
Laying out 18 libraries in virtual address space 0000008001000000-0000008100000000
Random base 0x0000008057330000
Assigned virtual address space slots for libraries:
/lib64/ld64.so.1                                             0000008057330000-00000080573673d0
/lib64/libc.so.6                                             0000008057370000-000000805751e090
/usr/lib64/libctutils.so.0                                   0000008057530000-000000805755b768
/usr/lib64/libcfont.so.0                                     0000008057560000-0000008057574778
/usr/lib64/libconsole.so.0                                   0000008057580000-0000008057594848
/usr/lib64/libctgeneric.so.0                                 00000080575a0000-00000080575b49a8
/lib64/librt.so.1                                            0000008057530000-000000805754a6a8
/lib64/libpthread.so.0                                       0000008057550000-00000080575831c0
/usr/lib64/libelf.so.1                                       0000008057530000-000000805755b660
/usr/lib64/libusb-1.0.so.0                                   0000008057590000-00000080575b0808
/usr/lib64/libusb-0.1.so.4                                   00000080575c0000-00000080575d59d8
/lib64/libattr.so.1                                          0000008057590000-00000080575a5958
/usr/lib64/libglib-2.0.so.0                                  00000080575b0000-00000080576e8b68
/lib64/libutil.so.1                                          0000008057530000-00000080575434a0
/lib64/libacl.so.1                                           00000080576f0000-0000008057709ee8
/lib64/libcrypt.so.1                                         0000008057530000-0000008057577708
/usr/lib64/libtinfo.so.5                                     0000008057530000-000000805756d928
/lib64/libdl.so.2                                            0000008057570000-0000008057583520
Would prelink /lib64/ld-2.13.so
Would prelink /lib64/libc-2.13.so
Would prelink /usr/bin/writevt
Would prelink /usr/lib64/libconsole.so.0.0.0
Would prelink /usr/lib64/libcfont.so.0.0.0
Would prelink /usr/lib64/libctutils.so.0.0.0
Would prelink /usr/lib64/libctgeneric.so.0.0.0
Would prelink /usr/bin/setkeycodes
Would prelink /sbin/shutdown.sysvinit
Would prelink /usr/lib64/libelf.so
Would prelink /usr/sbin/prelink-rtld
Would prelink /sbin/udevd
Would prelink /sbin/fstab-decode
Would prelink /lib64/libpthread-2.13.so
Would prelink /usr/bin/psfstriptable
Would prelink /usr/bin/splitfont
Would prelink /lib64/librt-2.13.so
Would prelink /usr/lib64/libusb-1.0.so.0.0.0
Would prelink /bin/busybox
Would prelink /usr/bin/codepage
Would prelink /usr/bin/setleds
Would prelink /usr/sbin/prelink
Would prelink /usr/lib64/libusb-0.1.so.4.4.4
Would prelink /lib64/udev/hid2hci
Would prelink /usr/bin/chvt.console-tools
Would prelink /lib64/udev/scsi_id
Would prelink /lib64/libdl-2.13.so
Would prelink /usr/bin/fgconsole.console-tools
Would prelink /usr/bin/showkey
Would prelink /lib64/udev/firmware
Would prelink /lib64/libattr.so.1.1.0
Would prelink /lib64/udev/pci-db
Would prelink /usr/bin/dumpkeys
Would prelink /lib64/udev/mtd_probe
Would prelink /lib64/udev/fstab_import
Would prelink /usr/bin/wall.sysvinit
Would prelink /usr/bin/consolechars
Would prelink /usr/lib64/libtinfo.so.5.9
Would prelink /bin/bash
Would prelink /usr/bin/screendump
Would prelink /usr/bin/showcfont
Would prelink /usr/bin/vcstime
Would prelink /lib64/udev/v4l_id
Would prelink /usr/bin/psfaddtable
Would prelink /lib64/libcrypt-2.13.so
Would prelink /bin/tinylogin
Would prelink /lib64/udev/keymap
Would prelink /usr/bin/utmpdump
Would prelink /lib64/udev/input_id
Would prelink /lib64/udev/path_id
Would prelink /lib64/udev/ata_id
Would prelink /usr/bin/getkeycodes
Would prelink /usr/bin/loadkeys
Would prelink /bin/mountpoint
Would prelink /lib64/udev/usb-db
Would prelink /lib64/udev/cdrom_id
Would prelink /usr/bin/setmetamode
Would prelink /usr/bin/last.sysvinit
Would prelink /lib64/udev/mobile-action-modeswitch
Would prelink /lib64/udev/create_floppy_devices
Would prelink /lib64/libutil-2.13.so
Would prelink /sbin/bootlogd
Would prelink /sbin/udevadm
Would prelink /usr/bin/kbd_mode
Would prelink /sbin/halt.sysvinit
Would prelink /usr/bin/deallocvt.console-tools
Would prelink /usr/lib64/libglib-2.0.so.0.2800.8
Would prelink /usr/bin/mesg.sysvinit
Would prelink /lib64/udev/collect
Would prelink /lib64/udev/edd_id
Would prelink /usr/bin/vt-is-UTF8
Would prelink /sbin/killall5
Would prelink /sbin/runlevel
Would prelink /lib64/udev/usb_id
Would prelink /usr/bin/psfgettable
Would prelink /lib64/libacl.so.1.1.0
Would prelink /lib64/udev/udev-acl
Would prelink /sbin/init.sysvinit
Would prelink /usr/sbin/update-passwd
Would prelink /usr/bin/setvesablank
Would prelink /usr/bin/openvt.console-tools
Comment 2 Kumar Gala 2011-08-04 11:36:16 UTC
Output from cross-prelink:

[ /local/home/galak/git/poky/build-p5020/tmp/sysroots/x86_64-linux/usr/sbin/prelink --root /local/home/galak/git/poky/build-p5020/tmp/work/p5020_ds-poky-linux/core-image-minimal-1.0-r0/rootfs -amR -n -v -N -c /etc/prelink.conf

]

Laying out 17 libraries in virtual address space 0000008001000000-0000008100000000
Random base 0x000000801fc70000
Assigned virtual address space slots for libraries:
/lib64/ld64.so.1                                             000000801fc70000-000000801fca73d0
/lib64/libc.so.6                                             000000801fcb0000-000000801fe5e090
/usr/lib64/libctutils.so.0                                   000000801fe70000-000000801fe9b768
/usr/lib64/libconsole.so.0                                   000000801fea0000-000000801feb4848
/usr/lib64/libcfont.so.0                                     000000801fec0000-000000801fed4778
/usr/lib64/libctgeneric.so.0                                 000000801fee0000-000000801fef49a8
/lib64/libpthread.so.0                                       000000801fe70000-000000801fea31c0
/lib64/librt.so.1                                            000000801feb0000-000000801feca6a8
/usr/lib64/libusb-0.1.so.4                                   000000801fed0000-000000801fee59d8
/usr/lib64/libusb-1.0.so.0                                   000000801fef0000-000000801ff10808
/usr/lib64/libtinfo.so.5                                     000000801fe70000-000000801fead928
/lib64/libcrypt.so.1                                         000000801fe70000-000000801feb7708
/lib64/libattr.so.1                                          000000801fed0000-000000801fee5958
/lib64/libdl.so.2                                            000000801feb0000-000000801fec3520
/lib64/libacl.so.1                                           000000801fef0000-000000801ff09ee8
/lib64/libutil.so.1                                          000000801fe70000-000000801fe834a0
/usr/lib64/libglib-2.0.so.0                                  000000801ff10000-0000008020048b68
Would prelink /lib64/ld-2.13.so
Would prelink /lib64/libc-2.13.so
Would prelink /usr/bin/writevt
Would prelink /usr/lib64/libconsole.so.0.0.0
Would prelink /usr/lib64/libcfont.so.0.0.0
Would prelink /usr/lib64/libctutils.so.0.0.0
Would prelink /usr/lib64/libctgeneric.so.0.0.0
Would prelink /usr/bin/setkeycodes
Would prelink /sbin/shutdown.sysvinit
Would prelink /sbin/udevd
Would prelink /sbin/fstab-decode
Would prelink /lib64/libpthread-2.13.so
Would prelink /usr/bin/psfstriptable
Would prelink /lib64/librt-2.13.so
Would prelink /usr/lib64/libusb-1.0.so.0.0.0
Would prelink /bin/busybox
Would prelink /usr/bin/codepage
Would prelink /usr/bin/setleds
Would prelink /usr/lib64/libusb-0.1.so.4.4.4
Would prelink /lib64/udev/hid2hci
Would prelink /usr/bin/chvt.console-tools
Would prelink /lib64/libdl-2.13.so
Would prelink /usr/bin/fgconsole.console-tools
Would prelink /usr/bin/showkey
Would prelink /lib64/udev/firmware
Would prelink /lib64/libattr.so.1.1.0
Would prelink /usr/bin/dumpkeys
Would prelink /lib64/udev/mtd_probe
Would prelink /lib64/udev/fstab_import
Would prelink /usr/bin/wall.sysvinit
Would prelink /usr/bin/consolechars
Would prelink /usr/lib64/libtinfo.so.5.9
Would prelink /bin/bash
Would prelink /usr/bin/screendump
Would prelink /usr/bin/showcfont
Would prelink /usr/bin/vcstime
Would prelink /lib64/udev/v4l_id
Would prelink /usr/bin/psfaddtable
Would prelink /lib64/libcrypt-2.13.so
Would prelink /bin/tinylogin
Would prelink /lib64/udev/scsi_id
Would prelink /usr/bin/utmpdump
Would prelink /lib64/udev/input_id
Would prelink /lib64/udev/path_id
Would prelink /lib64/udev/ata_id
Would prelink /usr/bin/getkeycodes
Would prelink /usr/bin/loadkeys
Would prelink /bin/mountpoint
Would prelink /lib64/udev/usb-db
Would prelink /lib64/udev/pci-db
Would prelink /usr/bin/splitfont
Would prelink /usr/bin/setmetamode
Would prelink /usr/bin/last.sysvinit
Would prelink /lib64/udev/keymap
Would prelink /lib64/udev/mobile-action-modeswitch
Would prelink /lib64/udev/create_floppy_devices
Would prelink /lib64/libutil-2.13.so
Would prelink /sbin/bootlogd
Would prelink /sbin/udevadm
Would prelink /usr/bin/kbd_mode
Would prelink /sbin/halt.sysvinit
Would prelink /usr/bin/deallocvt.console-tools
Would prelink /usr/lib64/libglib-2.0.so.0.2800.8
Would prelink /usr/bin/mesg.sysvinit
Would prelink /lib64/udev/collect
Would prelink /lib64/udev/edd_id
Would prelink /usr/bin/vt-is-UTF8
Would prelink /sbin/killall5
Would prelink /sbin/runlevel
Would prelink /lib64/udev/usb_id
Would prelink /usr/bin/psfgettable
Would prelink /lib64/udev/cdrom_id
Would prelink /lib64/libacl.so.1.1.0
Would prelink /lib64/udev/udev-acl
Would prelink /sbin/init.sysvinit
Would prelink /usr/sbin/update-passwd
Would prelink /usr/bin/setvesablank
Would prelink /usr/bin/openvt.console-tools
Comment 3 Mark Hatle 2011-08-17 14:33:56 UTC
Problem has been successfully reproduced.

Simple reproducer, build the eglibc from OE for a 64-bit PPC target.

Construct an image (with prelinker disabled), extract the image to a directory and run the following command:  

RTLD_TRACE_PRELINKING=/lib64/libc-2.13.so PATH=/home/mhatle/git/oss/oe-core/scripts:/home/mhatle/git/oss/oe-core/bitbake/bin/:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/mhatle/bin PRELINK_SYSROOT=/home/mhatle/git/oss/oe-core/build-ppc64/image gdb --args /home/mhatle/git/oss/oe-core/build-ppc64/tmp-eglibc/sysroots/x86_64-linux/usr/sbin//prelink-rtld --target-paths /lib64/libc-2.13.so

(adjusts paths as necessary)

The failure occurs:

Backtrace:


#0  0x000000000040b2fb in do_lookup_get_first (map=0x64cf80, hash=4027880617, gnu_hash=1) at ld-lookup.c:115
#1  0x000000000040b812 in do_lookup_versioned (undef_name=0x61fc36 "__libc_enable_secure", ref=0x635810, 
    result=0x7fffffffd9b0, scope=0x6258d0, i=1, version=0x625820, skip=0x0, type_class=0, machine=21)
    at ld-do-lookup.h:78
#2  0x000000000040bc64 in rtld_lookup_symbol_versioned64 (name=0x61fc36 "__libc_enable_secure", sym=0x635810, 
    scope=0x6258d0, version=0x625820, rtypeclass=0, undef_map=0x624fb0, machine=21) at ld-lookup.c:214
#3  0x000000000040734f in do_reloc (dso=0x616690, map=0x624fb0, scope=0x6258d0, sym=6, type=38) at ld-libs.c:978
#4  0x00000000004074cd in do_rel_section (dso=0x616690, map=0x624fb0, scope=0x6258d0, tag=7, section=8) at ld-libs.c:1013
#5  0x00000000004075b1 in do_relocs (dso=0x616690, map=0x624fb0, scope=0x6258d0, tag=7) at ld-libs.c:1032
#6  0x000000000040775f in handle_relocs_in_entry (entry=0x6248b0, dso_list=0x6248b0) at ld-libs.c:1071
#7  0x0000000000407811 in handle_relocs (dso=0x616690, dso_list=0x6248b0) at ld-libs.c:1098
#8  0x0000000000408769 in process_one_dso (dso=0x616690, host_paths=0) at ld-libs.c:1502
#9  0x00000000004081e9 in main (argc=3, argv=0x7fffffffddc8) at ld-libs.c:1364


Code in question:

112           if (match
113               && (bucket = map->l_buckets[hash % map->l_nbuckets]) != STN_UNDEF)
114             do
115               if (((map->l_chain[bucket] ^ hash) & ~1UL) == 0)
116                 {
117                   symidx = bucket;
118                   break;
119                 }


Value of "bucket" is: 2717543127   which of course appears to be bogus.


The code in question comes from commit:


commit 6b087faf9f37f28fd6b4caedbf6d7b7c3b2ab180
Author: Mark Hatle <mark.hatle@windriver.com>
Date:   Tue Jun 15 14:11:08 2010 -0500

    Add local hash calculations
    
    2009-04-23  Maciej W. Rozycki  <macro@codesourcery.com>
    
            Issue #5165
            * src/ld-lookup.c (rtld_elf_hash): Handle an initial NULL
            character correctly.  Reformat for consistency with
            rtld_elf_gnu_hash().
    
    2009-04-23  Maciej W. Rozycki  <macro@codesourcery.com>
    
            Issue #5165
            * src/ld-do-lookup.h (FCT): Remove the hash argument and
            calculate the value within the function.  Call
            do_lookup_get_first() and do_lookup_get_next() to iterate over
            symbols.
            * src/prelink.h (dynamic_info_is_set): Convert macro to a
            function.  Return 1 for success rather than the bit set.
            * src/ld-libs.h (ldlibs_link_map): Add l_gnu_hash, l_maskword64,
            l_nmaskwords, l_shift and l_maskwords members.
            * src/ld-libs.c (create_ldlibs_link_map): Handle the GNU hash.
            * src/ld-lookup.c (rtld_elf_gnu_hash): New function.
            (rtld_elf_any_hash): Likewise.
            (rtld_elf_hash): Move above "ld-do-lookup.h" inclusions.
            (do_lookup_get_first, do_lookup_get_next): New functions.
            (rtld_lookup_symbol): Remove hash calculation.
            (rtld_lookup_symbol_versioned): Likewise.
Comment 4 Mark Hatle 2011-08-18 13:22:27 UTC
Tracing through the code, it appears much of it is derived from glibc.  Further investigation and discussion with the original author of the cross-prelink code, the ldd/ld.so  prelink-rtld was intended to be kept in sync with glibc...

Obviously it hasn't been and this is likely the cause of the failure.  In order to fix this, the loader and resolver code needs to be resynced from the current version of glibc.
Comment 5 Mark Hatle 2011-08-22 18:41:25 UTC
I've resynced the entire loader from the latest version of glibc and I'm still getting the same segfault.

The issue occurs within the DT_GNU_HASH processing.  While going through the hash array, one of the index pointers points way off beyond the end of the array.  I can't find anything within GLIBC nor the DT_GNU_HASH spec to explain why this behavior is occurring.

I've tried a local workaround of simply detecting an overflow condition and that allows the system to continue with an undefined symbol message.  The system BTW is "__libc_secure".

I either need access to a PPC 64 system, or someone who can run some commands for me in order to continue working on this.  But at this point, it very well could be a compiler or linker problem.
Comment 6 Dongxiao Xu 2011-08-23 00:34:23 UTC
Mark, could you share your work on the prelink sync up with latest glibc?

I GDBed the bug 1374 (reporting a lot of undefined symbol, memset, strcpy, etc) and suspect the error may also related with the FCT() function, which is somewhat old.

Thanks,
Dongxiao
Comment 7 Kumar Gala 2011-08-23 06:28:11 UTC
(In reply to comment #5)
> I've resynced the entire loader from the latest version of glibc and I'm still
> getting the same segfault.
> 
> The issue occurs within the DT_GNU_HASH processing.  While going through the
> hash array, one of the index pointers points way off beyond the end of the
> array.  I can't find anything within GLIBC nor the DT_GNU_HASH spec to explain
> why this behavior is occurring.
> 
> I've tried a local workaround of simply detecting an overflow condition and
> that allows the system to continue with an undefined symbol message.  The
> system BTW is "__libc_secure".
> 
> I either need access to a PPC 64 system, or someone who can run some commands
> for me in order to continue working on this.  But at this point, it very well
> could be a compiler or linker problem.

Let me know what you would like me to try and run on the ppc 64-bit system to help debug.
Comment 8 Mark Hatle 2011-08-24 18:16:42 UTC
I may have found the root cause.  On a big-endian target, libelf is being helpful and byte swapping for us.  The problem is that the GNU_HASH section contains both 32-bit and 64-bit words in the same structure.  libelf is assuming everything is 32-bit causing the data structures to be swapped incorrectly.

It appears on a 64-bit big-endian machine we're doing some funky byteswapping which is causing elements 28 and 29 (32-bit) to be swapped.

The bucket structure loaded into memory looks like:


nbuckets : 0x11 (17)
symndx   : 0x3 (3)
maskwords: 0x4 (4)
shift2   : 0x8 (8)
bloom[4]    : 0x410420 (4260896)
bloom[6]    : 0x34002018 (872423448)
bloom[8]    : 0x40000289 (1073742473)
bloom[10]    : 0x4800505 (75498757)
buckets[12]  : 0x3 (3)
buckets[13]  : (nil) (0)
buckets[14]  : 0x6 (6)
buckets[15]  : 0x4 (4)
buckets[16]  : 0x8 (8)
buckets[17]  : (nil) (0)
buckets[18]  : 0xc (12)
buckets[19]  : 0xb (11)
buckets[20]  : 0xe (14)
buckets[21]  : 0xd (13)
buckets[22]  : 0x11 (17)
buckets[23]  : 0x10 (16)
buckets[24]  : 0x13 (19)
buckets[25]  : 0x12 (18)
buckets[26]  : 0x15 (21)
buckets[27]  : 0x14 (20)
buckets[28]  : 0xa1fa6ad7 (2717543127)
symndx[29]: 0x19 (25)
symndx[30]: 0xf66c3dd9 (4134288857)
symndx[31]: 0x692a260 (110273120)
symndx[32]: 0x7c96f087 (2090266759)
symndx[33]: 0xf66c3dd8 (4134288856)
symndx[34]: 0x24bbd60a (616289802)
symndx[35]: 0x3de00ec6 (1038094022)
symndx[36]: 0xb54a3769 (3041539945)
symndx[37]: 0x5475103d (1416958013)
symndx[38]: 0xed70d193 (3983593875)
symndx[39]: 0x914347a7 (2437105575)
symndx[40]: 0x3cbc6423 (1018979363)
symndx[41]: 0xf5e616f2 (4125497074)
symndx[42]: 0xb1df6b97 (2984209303)
symndx[43]: 0x7858de49 (2019089993)
symndx[44]: 0xb23c806b (2990309483)
symndx[45]: 0x1ceb853b (485197115)
symndx[46]: 0x866d3a46 (2255305286)
symndx[47]: 0x7c8ad2ef (2089472751)
symndx[48]: 0x9fd7b9dc (2681715164)
symndx[49]: 0xd39ad3c (221883708)
symndx[50]: 0xf01494a8 (4027880616)
symndx[51]: 0x9f28436b (2670216043)
symndx[52]: 0xeb014688 (3942729352)

It's 28 and 29 appear to be swapped incorrectly.  Item 29 should be 28...  Also the bloom filters appear to be incorrect.  From what I can tell they should be: 0000 0420 0041 2018, 3400 0289 4000 0505, etc...
Comment 9 Mark Hatle 2011-08-25 09:42:34 UTC
I'm 99% certain at this point that we have a toolchain bug causing an invalid GNU_HASH table.

It appears to me that 32-bit words 28 and 29 are swapped.  Using my commerical Code Sourcery toolchains I am NOT getting that behavior.

I'm going to spend a few minutes and attempt to bisect the changes in binutils and see if I can come up with a cause and/or fix.
Comment 10 Mark Hatle 2011-11-11 08:45:22 UTC
This was resolved in the cross-prelink tree:

Tree works as of: 	cross_prelink -- 7581928be8e6ccb83a092b3d1364741fe02c5df4
Comment 11 Matthew McClintock 2011-11-14 12:52:47 UTC
(In reply to comment #10)
> This was resolved in the cross-prelink tree:
> 
> Tree works as of:     cross_prelink -- 7581928be8e6ccb83a092b3d1364741fe02c5df4

How do I test this?(In reply to comment #10)
> This was resolved in the cross-prelink tree:
> 
> Tree works as of:     cross_prelink -- 7581928be8e6ccb83a092b3d1364741fe02c5df4

I tested this and still got this error:

VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing unused kernel memory: 320k freed
/sbin/init: relocation error: /lib64/libc.so.6: symbol _rtld_global_ro, version GLIBC_PRIVATE not defined in file ld64.so.1 with link time reference
Kernel panic - not syncing: Attempted to kill init!
Call Trace:

I tried 7581928be8e6ccb83a092b3d1364741fe02c5df4 and 18b787843dd9a4c72d7ede300eec57fc566f9cce

-M
Comment 12 Matthew McClintock 2011-11-14 14:41:37 UTC
*** Bug 1531 has been marked as a duplicate of this bug. ***
Comment 13 Matthew McClintock 2011-11-14 14:43:10 UTC
(In reply to comment #12)
> *** Bug 1531 has been marked as a duplicate of this bug. ***

This looks like *slightly* different issues with prelink according to what Kumar and I have seen on the console. I realized this after I marked the other a duplicate of this one.

Let's use this bug to track ppc64 prelink issues.
Comment 14 Mark Hatle 2012-01-03 10:29:52 UTC
Please retest with the latest version of the prelinker as of Dec 15th.

A number of small fixes were added to the rtld emulator which may resolve the problems you are seeing.

Assigning to Matthew McClintock to verify this is still an issue.
Comment 15 Matthew McClintock 2012-01-03 12:16:45 UTC
(In reply to comment #14)
> Please retest with the latest version of the prelinker as of Dec 15th.
> 
> A number of small fixes were added to the rtld emulator which may resolve the
> problems you are seeing.
> 
> Assigning to Matthew McClintock to verify this is still an issue.

Tested this with new prelink... appears to be working on bb1b660c5e3859b6c5a2ac8d739713e9989a4dd7
Comment 16 Matthew McClintock 2012-01-03 13:04:52 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > Please retest with the latest version of the prelinker as of Dec 15th.
> > 
> > A number of small fixes were added to the rtld emulator which may resolve the
> > problems you are seeing.
> > 
> > Assigning to Matthew McClintock to verify this is still an issue.
> 
> Tested this with new prelink... appears to be working on
> bb1b660c5e3859b6c5a2ac8d739713e9989a4dd7

I tested the wrong root file system here. Still seeing this error:

RAMDISK: gzip image found at block 0
VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing unused kernel memory: 320k freed
/sbin/init: relocation error: /lib64/libc.so.6: symbol _rtld_global_ro, version GLIBC_PRIVATE not defined in file ld64.so.1 with link time reference
Kernel panic - not syncing: Attempted to kill init!
Call Trace:
[c0000000fb09faf0] [c000000000009638] .show_stack+0x78/0x1b0 (unreliable)
[c0000000fb09fba0] [c00000000061393c] .panic+0x9c/0x1ec
[c0000000fb09fc40] [c000000000049e60] .do_exit+0x790/0x7a0
[c0000000fb09fd30] [c00000000004a170] .do_group_exit+0x50/0xf0
[c0000000fb09fdc0] [c00000000004a224] .SyS_exit_group+0x14/0x20
[c0000000fb09fe30] [c0000000000005a0] syscall_exit+0x0/0x2c
Rebooting in 180 seconds..
Comment 17 Matthew McClintock 2012-01-03 14:58:40 UTC
We compare the output of prelink-rtld on the host and target and they were the same.
Comment 18 Mark Hatle 2012-01-26 09:47:55 UTC
A further suggestion.  You had mentioned that running the prelinker on the target system produced functional binaries, leading to the suggestion this is an endian issue.

Could you please prelink on the target and copy off the binaries.. cross-prelink on the host and do a comparison?  Something has to be wrong, and I'd like to know if it's simply an endian switch of some type.

When doing the prelinking in both, be sure to disable the randomized addressing in the prelinker.
Comment 19 Jessica 2012-04-04 16:11:54 UTC
Matthew, per Mark's last comment, any update on your end regarding this bug?
Comment 20 Matthew McClintock 2012-04-04 16:29:44 UTC
I've not looked again since I last looked. It's on my list...
Comment 21 Chunrong Guo 2013-06-20 06:43:30 UTC
Problem still exists on 64-bit targets 

poky : commit e04e6dab0afa8f72bf001b0cc106cd13b7694a91
meta-fsl-ppc : commit d75b5c38492f5fa821b5b2cca89217bef6868420
branch : master 

1. Output from cross-prelink:
[  /home/jenkins/sdk_toolchain/poky/build/tmp/sysroots/x86_64-linux/usr/sbin/prelink --root /home/jenkins/sdk_toolchain/poky/build/tmp/work/p5020ds_64b-poky-linux/core-image-minimal/1.0-r0/rootfs/ -amR -n -v -N -c /etc/prelink.conf
]
Laying out 10 libraries in virtual address space 0000008001000000-0000008100000000
Random base 0x00000080a2120000
Assigned virtual address space slots for libraries:
/lib64/ld64.so.1                                             00000080b0bb0000-00000080b0be94f0
/lib64/libc.so.6                                             00000080a2120000-00000080a22dc750
/lib64/librt.so.1                                            00000080a22e0000-00000080a22fa6d0
/lib64/libpthread.so.0                                       00000080a2300000-00000080a2333278
/usr/lib64/libelf.so.1                                       00000080a22e0000-00000080a230b6a0
/lib64/libuuid.so.1                                          00000080a2340000-00000080a23549d8
/lib64/libblkid.so.1                                         00000080a2360000-00000080a23b99e8
/usr/lib64/libkmod.so.2                                      00000080a23c0000-00000080a23e9dd8
/lib64/libcrypt.so.1                                         00000080a22e0000-00000080a2328798
/lib64/libutil.so.1                                          00000080a22e0000-00000080a22f34d0
/lib64/libm.so.6                                             00000080a2340000-00000080a2400688
Would prelink /lib64/libc-2.17.so
Would prelink /lib64/libpthread-2.17.so
Would prelink /lib64/librt-2.17.so
Would prelink /lib/udev/collect
Would prelink /usr/bin/showconsolefont
Would prelink /lib64/libm-2.17.so
Would prelink /lib/udev/keymap
Would prelink /sbin/fstab-decode
Would prelink /usr/lib64/libelf-0.148.so
Would prelink /lib/udev/scsi_id
Would prelink /sbin/init.sysvinit
Would prelink /usr/lib64/libkmod.so.2.1.3
Would prelink /usr/sbin/prelink-rtld
Would prelink /lib/udev/v4l_id
Would prelink /sbin/killall5
Would prelink /usr/bin/setleds
Would prelink /usr/bin/deallocvt.kbd
Would prelink /usr/bin/showkey
Would prelink /usr/bin/kbdrate
Would prelink /usr/bin/setfont
Would prelink /sbin/shutdown.sysvinit
Would prelink /usr/bin/mapscrn
Would prelink /usr/bin/mesg.sysvinit
Would prelink /usr/bin/loadkeys
Would prelink /usr/bin/psfxtable
Would prelink /lib64/libcrypt-2.17.so
Would prelink /bin/tinylogin
Would prelink /usr/bin/setmetamode
Would prelink /lib/udev/ata_id
Would prelink /lib64/libuuid.so.1.3.0
Would prelink /usr/bin/last.sysvinit
Would prelink /usr/bin/getkeycodes
Would prelink /sbin/runlevel.sysvinit
Would prelink /bin/busybox
Would prelink /lib64/libutil-2.17.so
Would prelink /lib64/libblkid.so.1.1.0
Would prelink /usr/bin/udevadm
Would prelink /usr/bin/setkeycodes
Would prelink /lib/udev/udevd
Would prelink /usr/bin/fgconsole.kbd
Would prelink /usr/bin/dumpkeys
Would prelink /lib/udev/mtd_probe
Would prelink /bin/mountpoint.sysvinit
Would prelink /usr/bin/utmpdump.sysvinit
Would prelink /sbin/bootlogd
Would prelink /usr/bin/chvt.kbd
Would prelink /lib/udev/accelerometer
Would prelink /usr/bin/loadunimap
Would prelink /usr/bin/kbd_mode
Would prelink /usr/bin/wall.sysvinit
Would prelink /lib/udev/cdrom_id
Would prelink /usr/bin/openvt.kbd
Would prelink /usr/sbin/prelink
Would prelink /usr/bin/execstack
Would prelink /sbin/halt.sysvinit

2. I add prelink in core-image-minimal and build core-image-minimal for p5020ds-64b target . When booting up via sata , the system would print the following message, then no response anymore

VFS: Mounted root (ext2 filesystem) on device 8:1.
devtmpfs: mounted
Freeing unused kernel memory: 324k freed
/sbin/init: relocation error: /lib64/libc.so.6: symbol _rtld_global_ro, version GLIBC_PRIVATE not defined in file ld64.so.1 with link time reference
Kernel panic - not syncing: Attempted to kill init!
Call Trace:
[c0000000f90a3ae0] [c0000000000099f8] .show_stack+0x78/0x1b0 (unreliable)
[c0000000f90a3b90] [c0000000006777dc] .panic+0x9c/0x1e4
[c0000000f90a3c30] [c00000000004ef10] .do_exit+0x7d0/0x7e0
[c0000000f90a3d30] [c00000000004f214] .do_group_exit+0x54/0xf0
[c0000000f90a3dc0] [c00000000004f2c4] .SyS_exit_group+0x14/0x20
[c0000000f90a3e30] [c000000000000598] syscall_exit+0x0/0x2c
Rebooting in 180 seconds..
Comment 22 Chunrong Guo 2013-06-20 09:28:19 UTC

jenkins@topsy:~/sdk_toolchain/poky/build$  /home/jenkins/sdk_toolchain/poky/build/tmp/sysroots/x86_64-linux/usr/sbin/prelink --root /home/jenkins/sdk_toolchain/poky/build/tmp/work/p4080ds-poky-linux/core-image-minimal/1.0-r0/rootfs/ -amR -n -v -N -c /etc/prelink.conf
Assigned virtual address space slots for libraries:
/lib/ld.so.1                                                 0ffc0000-0fff2198
/lib/libc.so.6                                               0fe30000-0ffb8c90
/lib/libpthread.so.0                                         0fe00000-0fe296d0
/lib/librt.so.1                                              0fde0000-0fdf7540
/usr/lib/libelf.so.1                                         0fe00000-0fe27404
/usr/lib/libkmod.so.2                                        0fd90000-0fdb5c50
/lib/libblkid.so.1                                           0fd40000-0fd8cfe8
/lib/libuuid.so.1                                            0fdc0000-0fdd3b44
/lib/libutil.so.1                                            0fe10000-0fe22210
/lib/libm.so.6                                               0fd20000-0fddc400
/lib/libcrypt.so.1                                           0fde0000-0fe202cc
Would prelink /usr/bin/udevadm
Would prelink /lib/udev/udevd
Comment 23 Mark Hatle 2015-11-02 17:10:48 UTC
PPC 64 has moved to an 'ELFv2' which the prelinker does not understand.

At some point we will need to implement support for ELFv2.
Comment 24 Stephen K Jolley 2015-11-19 16:05:13 UTC
This was REOPENED