Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 06-06-2014, 05:34 PM   #1
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
ARMhf on the Kindle(s)

An old subject, born again - -
Our plan to extend the availability of applications for the Kindle:
https://bitbucket.org/twobob/kual-system

That plan above will have to be altered to accommodate the hard-coded search behavior of the multi-lib'd dynamic loader.
And it will have to be re-written to account for the system tree change @ v-0.3

The Quick and Dirty way to get rich with Porn <<-- Do Not Read This Spoiler -->>
you might go blind.
Spoiler:

Thread Layout
Abstracts of each major milestone, with links to deeper posts holding details.
The most recently released archives as attachments here.
Some of the deeper, detail, posts have attachments also, mostly to maintain a progress record of this thread's development.

What this thread covers
The development of Kindle system, system libraries that can live in USB storage ( */extensions/system/{*} ).
These system libraries are customizations that can live and work outside of the standard "trusted directory" structure of *nix systems.

Also contained in this thread is the information required for someone else to duplicate and/or extend this part of the Kindle development.

The end result will be a set of modern system libraries that can run (the **binary** version of) applications "ported" from major Linux distributions.
In this case, the "porting" required will be editing the headers of the binaries. There is a utility tool attached here for that purpose (patchelf).

System Overview
Compiler: gnu-GCC v-4.9.0

BinUtils: v2.23.2

System library(ies): gnu-(E)glibc v-2.19
(v-2.20 requires kernels newer than the ones Amazon provides on the Kindles.)
Spoiler:

Code:
[root@kindle root]# cd /mnt/us/extensions/system/lib
[root@kindle lib]# ls
ld-linux-armhf.so.3  libc.so.6
[root@kindle lib]# ./libc.so.6
GNU C Library (Buildroot) stable release version 2.19, by Roland McGrath et al.
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.9.0.
Compiled on a Linux 3.0.101 system on 2014-06-11.
Available extensions:
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
libc ABIs: UNIQUE
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.

Known problem(s), see: https://www.mobileread.com/forums/sho...0&postcount=22

Debugger: GDB v-7.5

Builds:
ARMhf-A8-VFPV3D16
( for K4 ... PW1 and will run on PW2, matches current Debian/Ubuntu applications.
See: https://wiki.debian.org/ArmHardFloatPort )
Spoiler:

Code:
BR2_ARCH="arm"
BR2_ENDIAN="LITTLE"
BR2_GCC_TARGET_ARCH="armv7-a"
BR2_GCC_TARGET_ABI="aapcs-linux"
BR2_GCC_TARGET_CPU="cortex-a8"
BR2_GCC_TARGET_FPU="vfpv3-d16"
BR2_GCC_TARGET_FLOAT_ABI="hard"
BR2_GCC_TARGET_MODE="arm"
BR2_ARM_CPU_HAS_NEON=y
BR2_ARM_CPU_HAS_VFPV2=y
BR2_ARM_CPU_HAS_VFPV3=y
BR2_ARM_CPU_HAS_THUMB2=y
BR2_cortex_a8=y
BR2_ARM_EABIHF=y
BR2_ARM_FPU_VFPV3D16=y
BR2_ARM_INSTRUCTIONS_ARM_CHOICE=y
BR2_ARM_INSTRUCTIONS_ARM=y

ARMhf-A9-NEON ( for PW2 )
Spoiler:

Code:
BR2_ARCH="arm"
BR2_ENDIAN="LITTLE"
BR2_GCC_TARGET_ARCH="armv7-a"
BR2_GCC_TARGET_ABI="aapcs-linux"
BR2_GCC_TARGET_CPU="cortex-a9"
BR2_GCC_TARGET_FPU="neon"
BR2_GCC_TARGET_FLOAT_ABI="hard"
BR2_GCC_TARGET_MODE="arm"
BR2_ARM_CPU_HAS_NEON=y
BR2_ARM_CPU_MAYBE_HAS_NEON=y
BR2_ARM_CPU_MAYBE_HAS_VFPV2=y
BR2_ARM_CPU_MAYBE_HAS_VFPV3=y
BR2_ARM_CPU_HAS_THUMB2=y
BR2_cortex_a9=y
BR2_ARM_EABIHF=y
BR2_ARM_ENABLE_NEON=y
BR2_ARM_FPU_NEON=y
BR2_ARM_INSTRUCTIONS_ARM_CHOICE=y
BR2_ARM_INSTRUCTIONS_ARM=y

and something for the K3 - am still working on that one

Compiler / Linker magic
Building for system libraries outside of the trusted locations requires additional options be passed for those building software.
Shown is the Buildroot version, but the contents of the option are the same, regardless of the build method:
Edit: Updated to V-0.3 specs.
Code:
BR2_TARGET_LDFLAGS="-Wl,--dynamic-linker=/mnt/us/esys/lib/ld-linux-armhf.so.3,-rpath=/mnt/us/esys/lib:/mnt/us/esys/usr/lib,-z,nodeflib,--enable-new-dtags"
Version 0.9999999x+
Run the bionic system libraries from USB storage.
Naw, noboby wants to run Android apps on a Kindle.
Maybe musl though. ( http://www.musl-libc.org/ )

PatchElf 0.8
A required utility for putting binaries outside of the FHS trusted locations.
See: https://www.mobileread.com/forums/sho...88&postcount=9
Usage examples: See the commented script in the "helpers" attachment.

Version 0.5
Add "Ledger v3.0" from Debian/Jessie
This will also add-in fairly complete C++ application support.

Version 0.4
Add ld.so audit support.
Package up the -dev files add-on.

Version 0.3
Note to self and others:
Do not try to package and release new system libraries on Friday the 13th.
Replaced Lua-5.1.5 with LuaJit-2.0.3 (which also runs Lua-5.1 code and source) in base system.
Added nano-2.3.2 (because I hate busybox vi - which is still there).
Redefined our external, hard-float, system tree.
Installation and Usage: https://www.mobileread.com/forums/sho...1&postcount=47
Coding example: https://www.mobileread.com/forums/sho...2&postcount=56
Note: Only tested on KPW-1, firmware 5.3.3
Linaro toolchain: http://releases.linaro.org/14.05/com...gcc-linaro/4.9

Older stuff:
"Plan B" died a horrible death at V-0.2.2 - see: https://www.mobileread.com/forums/sho...7&postcount=46
Spoiler:

Version 0.2.1
Use (correct) absolute pathnames in headers.
Picked up a few files and directories missed in v-0.2

Gottcha in this build:
You must use the form: busybox arguments to get bb-v1.22 rather than bb-v-whatever.

Install, see: https://www.mobileread.com/forums/sho...0&postcount=34

Version 0.2
The plan:
Spoiler:

Dynamic linking support:
* Remove sym-links by renaming libraries to their SONAME
(Details: https://www.mobileread.com/forums/sho...45&postcount=3)
* Add custom path to dynamic loader
* Add binary relative search paths
(Notes: https://www.mobileread.com/forums/sho...0&postcount=18)

Build-time linker support: Replace sym-links with one line load scripts
Busybox sym-links: Repace sym-links with shell wrappers (twobob style)
Packaging: Split and packaged as -run and -dev (additional files)


Current post (see also: https://www.mobileread.com/forums/sho...postcount=34):
glibc + its feature libs + busybox + lua + dependent libraries
tar-ball has the extensions/system/* sub-tree (move to device as-is)
Re-set your path per:
export PATH=/mnt/us/extensions/system/bin:/mnt/us/extensions/system/usr/bin:$PATH

Gottcha in this build:
You must use the form: busybox arguments to get bb-v1.22 rather than bb-v-whatever.

Lua is working (and loads a slue of system libraries - so that works also)
( for the non-lua fans: to exit, enter: os.exit(0) )

helpers-0.2.tar.gz is just a collection of small scripts used to make this release.

PatchElf v0.8
Like it or not, we have to have it.
The *.tar.gz is the binary and manuals
The *.zip is the source used.
Details in: https://www.mobileread.com/forums/sho...88&postcount=9

Version 0.1:
For the sake of future reference, the original, minimal (loader, glibc, busybox) tarball for */extensions/system/{bin,lib} is attached at:
https://www.mobileread.com/forums/sho...64&postcount=4
Which should work on k4, k5-touch and was minimally tested on a k5-PW1
Should also run on the PW2, although it is not optimized for the i.MX6 feature set.
Note: Expect it to fail whenever glibc has to dlopen any of its support libraries.
Attached Files
File Type: gz patchelf-0.8.tar.gz (46.6 KB, 449 views)
File Type: zip patchelf-0.8.zip (62.3 KB, 414 views)
File Type: gz base-0.3-a8_armhf_vfpv3d16.tar.gz (2.38 MB, 495 views)
File Type: gz helpers-v0.3.tar.gz (2.5 KB, 429 views)
File Type: gz base-v03-images.tar.gz (5.41 MB, 443 views)

Last edited by knc1; 06-16-2014 at 07:11 AM.
knc1 is offline   Reply With Quote
Old 06-06-2014, 06:44 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
You'll also have to push the full hardf libc suite matching the TC used to the libdir the rpath points to, or things will go kaboom in fun & interesting ways .
NiLuJe is offline   Reply With Quote
Advert
Old 06-06-2014, 08:52 PM   #3
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by NiLuJe View Post
You'll also have to push the full hardf libc suite matching the TC used to the libdir the rpath points to, or things will go kaboom in fun & interesting ways .
The system libraries, names and dependences:
Note: These lists are from the (dead) V-0.2.x series of builds.
Spoiler:

Code:
core2quad lib $ for f in `ls -1 *-2.19*` ; do echo $f ; readelf -dl $f | egrep 'SONAME|RUNPATH|NEEDED|Requesting' ; done
ld-2.19.so
 0x0000000e (SONAME)                     Library soname: [ld-linux-armhf.so.3]
libc-2.19.so
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [ld-linux-armhf.so.3]
 0x0000000e (SONAME)                     Library soname: [libc.so.6]
libcrypt-2.19.so
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libcrypt.so.1]
libdl-2.19.so
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [ld-linux-armhf.so.3]
 0x0000000e (SONAME)                     Library soname: [libdl.so.2]
libm-2.19.so
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libm.so.6]
libnsl-2.19.so
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libnsl.so.1]
libnss_dns-2.19.so
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libresolv.so.2]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libnss_dns.so.2]
libnss_files-2.19.so
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libnss_files.so.2]
libpthread-2.19.so
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [ld-linux-armhf.so.3]
 0x0000000e (SONAME)                     Library soname: [libpthread.so.0]
libresolv-2.19.so
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [ld-linux-armhf.so.3]
 0x0000000e (SONAME)                     Library soname: [libresolv.so.2]
librt-2.19.so
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [librt.so.1]
libutil-2.19.so
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libutil.so.1]
core2quad lib $

Which will need a little bit of post-build fix-up.

Busybox, Lua and C++ additions:
Spoiler:

Code:
core2quad lib # for f in `find . -executable -a ! -type d -a ! -type l` ; do echo $f ; readelf -dl $f | egrep 'SONAME|RUNPATH|NEEDED|Requesting' ; done
./libhistory.so.6.3
 0x00000001 (NEEDED)                     Shared library: [libncurses.so.5]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libhistory.so.6]
 0x0000001d (RUNPATH)                    Library runpath: [/mnt/us/extensions/system/lib:/mnt/us/extensions/system/usr/lib:/usr/lib]
./liblua.so.5.1.5
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [liblua.so.5.1.5]
./libreadline.so.6.3
 0x00000001 (NEEDED)                     Shared library: [libncurses.so.5]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libreadline.so.6]
 0x0000001d (RUNPATH)                    Library runpath: [/mnt/us/extensions/system/lib:/mnt/us/extensions/system/usr/lib:/usr/lib]
./libncurses.so.5.9
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libncurses.so.5]
 0x0000001d (RUNPATH)                    Library runpath: [/mnt/us/extensions/system/lib:/mnt/us/extensions/system/usr/lib]
./libstdc++.so.6.0.20
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x00000001 (NEEDED)                     Shared library: [ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x0000000e (SONAME)                     Library soname: [libstdc++.so.6]
core2quad lib #

Which will also need to be diddled.

And our starter-pack of two applications:
Spoiler:

Code:
core2quad tmp # for f in bin/busybox usr/bin/{lua,luac} ; do echo $f ; readelf -dl $f | egrep 'SONAME|RUNPATH|NEEDED|Requesting' ; done
bin/busybox
      [Requesting program interpreter: /mnt/us/extensions/system/lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000001d (RUNPATH)                    Library runpath: [/mnt/us/extensions/system/lib:/mnt/us/extensions/system/usr/lib]
usr/bin/lua
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [liblua.so.5.1.5]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.2]
 0x00000001 (NEEDED)                     Shared library: [libreadline.so.6]
 0x00000001 (NEEDED)                     Shared library: [libhistory.so.6]
 0x00000001 (NEEDED)                     Shared library: [libncurses.so.5]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
usr/bin/luac
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.2]
 0x00000001 (NEEDED)                     Shared library: [libreadline.so.6]
 0x00000001 (NEEDED)                     Shared library: [libhistory.so.6]
 0x00000001 (NEEDED)                     Shared library: [libncurses.so.5]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
core2quad tmp #

Actually, worse than it looks - the Buildroot Lua package is broken (ignoring the LDFLAGS setting in BR GUI).

Note: I may decide that 'Ledger' will be part of the base install (for tracking what is installed and in-use).

Last edited by knc1; 06-14-2014 at 10:04 AM.
knc1 is offline   Reply With Quote
Old 06-06-2014, 09:42 PM   #4
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by NiLuJe View Post
You'll also have to push the full hardf libc suite matching the TC used to the libdir the rpath points to, or things will go kaboom in fun & interesting ways .
The first (simplest case) testing:
Spoiler:

Code:
[root@kindle system]# pwd
/mnt/us/extensions/system
[root@kindle system]# ls -l *
bin:
-rwxr-xr-x    1 root     root        605348 Jun  6  2014 busybox

lib:
-rwxr-xr-x    1 root     root        130228 Jun  6  2014 ld-2.19.so
-rwxr-xr-x    1 root     root       1234140 Jun  6  2014 libc.so.6
[root@kindle system]# bin/busybox
BusyBox v1.22.1 (2014-06-06 15:39:01 CDT) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2012.
Licensed under GPLv2. See source distribution for detailed
copyright notices.

Usage: busybox [function [arguments]...]
   or: busybox --list[-full]
   or: busybox --install [-s] [DIR]
   or: function [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  Most people will create a
        link to busybox for each function they wish to use and BusyBox
        will act like whatever it was invoked as.

Currently defined functions:
        [, [[, addgroup, adduser, ar, arping, ash, awk, basename, blkid, bunzip2, bzcat, cat, catv, chattr,
        chgrp, chmod, chown, chroot, chrt, chvt, cksum, clear, cmp, cp, cpio, crond, crontab, cut, date,
        dc, dd, deallocvt, delgroup, deluser, devmem, df, diff, dirname, dmesg, dnsd, dnsdomainname,
        dos2unix, du, dumpkmap, echo, egrep, eject, env, ether-wake, expr, false, fdflush, fdformat, fgrep,
        find, fold, free, freeramdisk, fsck, fstrim, fuser, getopt, getty, grep, gunzip, gzip, halt,
        hdparm, head, hexdump, hostid, hostname, hwclock, id, ifconfig, ifdown, ifup, inetd, init, insmod,
        install, ip, ipaddr, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kill, killall, killall5,
        klogd, last, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname,
        losetup, ls, lsattr, lsmod, lsof, lspci, lsusb, lzcat, lzma, makedevs, md5sum, mdev, mesg,
        microcom, mkdir, mkfifo, mknod, mkswap, mktemp, modprobe, more, mount, mountpoint, mt, mv, nameif,
        netstat, nice, nohup, nslookup, od, openvt, passwd, patch, pidof, ping, pipe_progress, pivot_root,
        poweroff, printenv, printf, ps, pwd, rdate, readlink, readprofile, realpath, reboot, renice, reset,
        resize, rm, rmdir, rmmod, route, run-parts, runlevel, sed, seq, setarch, setconsole, setkeycodes,
        setlogcons, setserial, setsid, sh, sha1sum, sha256sum, sha3sum, sha512sum, sleep, sort,
        start-stop-daemon, strings, stty, su, sulogin, swapoff, swapon, switch_root, sync, sysctl, syslogd,
        tail, tar, tee, telnet, test, tftp, time, top, touch, tr, traceroute, true, tty, udhcpc, umount,
        uname, uniq, unix2dos, unlzma, unxz, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock,
        watch, watchdog, wc, wget, which, who, whoami, xargs, xz, xzcat, yes, zcat

[root@kindle system]# bin/busybox free
             total         used         free       shared      buffers
Mem:        256192       220716        35476            0        19956
-/+ buffers:             200760        55432
Swap:            0            0            0

[root@kindle system]#
Whoot!!
Our own loader and a modern, hard float, glibc.
Code:
[root@kindle lib]# ./ld-2.19.so
Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
You have invoked `ld.so', the helper program for shared library executables.
This program usually lives in the file `/lib/ld.so', and special directives
in executable files using ELF shared libraries tell the system's program
loader to load the helper program from this file.  This helper program loads
the shared libraries needed by the program executable, prepares the program
to run, and runs it.  You may invoke this helper program directly from the
command line to load and run an ELF executable file; this is like executing
that file itself, but always uses this helper program from the file you
specified, instead of the helper program file specified in the executable
file you run.  This is mostly of use for maintainers to test new versions
of this helper program; chances are you did not intend to run this program.

  --list                list all dependencies and how they are resolved
  --verify              verify that given object really is a dynamically linked
                        object we can handle
  --inhibit-cache       Do not use /etc/ld.so.cache
  --library-path PATH   use given PATH instead of content of the environment
                        variable LD_LIBRARY_PATH
  --inhibit-rpath LIST  ignore RUNPATH and RPATH information in object names
                        in LIST
  --audit LIST          use objects named in LIST as auditors
Also, a modern (hardfloat - not that it matters) busybox.

Give me a few to tar this up with the proper */extensions/system/{lib,bin} paths and I'll attach this pre-alpha thing here. Done.

tomorrow - a hard float Lua
(Lua only has one numeric type: double (precision floating point) and makes heavy us of dlopen. - should be a good test vehicle of my library munging skills.)

Edit: This libc has the default loader hardcoded, but since it is a library, it doesn't seem to matter.
I will put building a "patchelf" high on my todo list to have on hand, just in case it does matter.
Ref: http://anonscm.debian.org/gitweb/?p=....git;a=summary
(Which happens to be written in C++, one of this thread's goals to support.)
Attached Files
File Type: gz ARMhf-0.1-minimal.tar.gz (982.0 KB, 490 views)

Last edited by knc1; 06-07-2014 at 08:48 AM.
knc1 is offline   Reply With Quote
Old 06-07-2014, 08:49 AM   #5
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
The original top post - for sake of history

This is **not** the specific plan being followed now!!

This is (was) the starting point of this thread.
The links and general information here are relevant, most of the build details are not.

= = = =

*) Picked a build system to use
(Buildroot, v2014.05, see: http://buildroot.net/download.html)

*) Leaving that local repo copy alone, clone it (disk-to-disk) into a workplace that can be easily sacrificed when things go really wrong.

*) If this isn't the first time using the above sacrificial clone, do:
make clean

*) Use the 'make menuconfig' command to select arch and toolchain options.
Here, I am using the 'Cortex-A8' selection, with EABIhf
Selected C++ support, since we want to support C++ sources.

*) Also selected:
Linux headers: 3.0 (I may have to change that, but that is as old as this version goes without patching it).
BinUtils: 2.23.2
gcc: 4.8.2
glibc: 2.19

*) Let Buildroot do its thing about creating this toolchain:
make toolchain

*) Now, to funky up the build system options to create binaries that reference our (hard float) dynamic loader and hard float libraries (which will live in USB storage).
make menuconfig
Set the "Target Linker Options" to this god-awful looking thing:
Code:
-Wl,--dynamic-linker=/mnt/us/extensions/system/lib/ld-2.19.so,-rpath=/mnt/us/extensions/system/lib,--enable-new-dtags
The short version of "why" - -
When the kernel is told to run an executable, it:
Reads the executable's header and finds that it is dynamically linked -
Then it reads the header to find out what dynamic loader to use (our hard float dynamic loader: ld-2.19.so, not Amazon's old soft float dynamic loader) -
The kernel then loads and runs that dynamic loader, passing along the information on what should be loaded and run.

Yup - thats it, the kernel never "runs" the executable you requested, it only runs the dynamic loader and lets ld.so worry about the details.

*) Build a dynamically linked BR application (Busybox, since it is already set-up by default):
make busybox

*) Use readelf to see if things are looking at least reasonable:
Code:
core2quad bin $ readelf -dl busybox

Elf file type is EXEC (Executable file)
Entry point 0xdbd0
There are 8 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  EXIDX          0x092a20 0x0009aa20 0x0009aa20 0x00008 0x00008 R   0x4
  PHDR           0x000034 0x00008034 0x00008034 0x00100 0x00100 R E 0x4
  INTERP         0x000134 0x00008134 0x00008134 0x00029 0x00029 R   0x1
      [Requesting program interpreter: /mnt/us/extensions/system/lib/ld-2.19.so]
  LOAD           0x000000 0x00008000 0x00008000 0x92a2c 0x92a2c R E 0x8000
  LOAD           0x093000 0x000a3000 0x000a3000 0x00782 0x02a3c RW  0x8000
  DYNAMIC        0x09300c 0x000a300c 0x000a300c 0x000f8 0x000f8 RW  0x4
  NOTE           0x000160 0x00008160 0x00008160 0x00020 0x00020 R   0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4

 - - - -

Dynamic section at offset 0x9300c contains 26 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000f (RPATH)                      Library rpath: [/mnt/us/extensions/system/lib]
 0x0000001d (RUNPATH)                    Library runpath: [/mnt/us/extensions/system/lib]
 0x0000000c (INIT)                       0xb8c4
 0x0000000d (FINI)                       0x7d460
- - - -
A bit of background on that:
http://blog.tremily.us/posts/rpath/

And a correction, patchelf **can** edit in a longer string:
http://nixos.org/patchelf.html
Note: that page needs a correction also, to the correct, current, form of the load flag options.

But, why all of this effort?
Because with our own hard float library and library loader, then all we need is patchelf and anything from the Debian ARMhf repository can be edited to run on "our" system.

**) Whoot!
Looking good so far.
Now just need to do some file location mangling and test if it works.

(Probably not, this is the 'pre-alpha' test stage and I most likely missed some critical details.)

Then, once the above (pure C source) is working, get the C++ stuff working.

A nice little summer project.

Last edited by knc1; 06-11-2014 at 08:08 AM.
knc1 is offline   Reply With Quote
Advert
Old 06-07-2014, 10:54 AM   #6
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
The quick and dirty on DT_tags

Pathnames:

There are two pathname tags of interest in runtime dynamic loading.
There is also an (un-documented) maximum string length limit.
Which was the death of the V-0.2 series of builds.

Two tags, four cases:
0) Neither (the default linker output)
1) DT_RPATH (only)
2) DT_RUNPATH (only)
3) Both

For case #3 (Both), the DT_RPATH tag is ignored and the DT_RUNPATH is used (I.E: Collapses into a case #2).

Case 1: DT_RPATH (only)
Provides the path(s) to be searched for the NEEDED soname libraries.
This path is used in all searches, it is not restricted to the imports of the ELF file it appears in.

This tag **DOES** over-ride LD_LIBRARY_PATH environment settings.

Case 2: DT_RUNPATH (only or both)
Provides the path(s) to be searched for the NEEDED soname libraries.
This path is used ONLY for searching for the imports of the ELF file it appears in. I.E: Its scope is the current file requesting the import of other soname libraries.

This tag **DOES NOT** over-ride LD_LIBRARY_PATH environment settings.

All cases (including Case 0):
Unless over-ridden, the loader will search the system directories: /lib and /usr/lib.
(Which is useless for this thread, those are all soft-float libraries that we can not link with.)

Filenames:

Linux (and all *nix systems) follow a library naming convention that includes the ABI and library version in the visible filename.
Details: http://tldp.org/HOWTO/Program-Librar...libraries.html

The internal (DT_SONAME) of the library is the load-time, actual, name of the library.

For instance:
Code:
Dynamic section at offset 0xaf04 contains 23 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libbsd.so.0]
I.E:
Quote:
Every shared library has a special name called the ``soname''. The soname has the prefix ``lib'', the name of the library, the phrase ``.so'', followed by a period and a version number that is incremented whenever the interface changes (as a special exception, the lowest-level C libraries don't start with ``lib'').
So this file contains the [lib] bsd [.so] [.0] code, regardless of its external name on the file system.
And the (symbol) imports should be found in the file with the internal (soname) [lib] c [.so] [.6] code, regardless of its external name on the file system.

In the above case, the name of this file on the file system is:
Code:
core2quad lib $ ls -l libbsd.so.0.3.0
-rw-r--r-- 1 root root 46744 2011-06-04 01:19 libbsd.so.0.3.0
Which has the major [.3] and minor [.0] version numbers appended to the soname.

On file systems which support symbolic links, the soname appears on the file system as a symbolic link to the fully versioned binary.
Code:
core2quad lib $ ls -l libbsd.so.0*
lrwxrwxrwx 1 root root    15 2012-06-07 22:06 libbsd.so.0 -> libbsd.so.0.3.0
-rw-r--r-- 1 root root 46744 2011-06-04 01:19 libbsd.so.0.3.0
Since FAT32 does not support dynamic links, we have two choices:
* Rename the fully versioned binary to the soname (what I did in version-0.1 to the libc library)
or
* Leave the binary with its fully versioned name and just let the loader search for it.

(or
Get the loader to use a cache file in a non-standard location.
That could be done, but might not be worth the effort to maintain.
This is a slow e-book not a high-performance machine.
)

- - - - -

Unrelated to dynamic loading, there is another naming convention used by the build-time linker.

From the -lbsd option passed to the compiler/linker -
The "-l" specifies a name mangling that adds the 'lib' prefix and the '.so' dynamic library extension.

The build-time linker then searchs for: libbsd.so for the code to link.
On Linux (and other *nix) development systems, this name will also be a symbolic link to the fully versioned filename of the library binary.

But FAT32 does not do symbolic links.
Does that mean we can't do program development on FAT32 - No
(Although it certainly isn't recommended, it can be done. )

Creating a file named: libbsd.so
with the contents:
Code:
INPUT(libbsd.so.0.3.0)
(or to the file named the same as the soname, if we choose to rename the fully versioned binary)

Will keep the build-time linker happy.

Edit:
Could I patch ld.so to follow the same convention?
Interesting thought (and it might already do it, will have to read the source).

Last edited by knc1; 06-14-2014 at 10:06 AM.
knc1 is offline   Reply With Quote
Old 06-08-2014, 09:34 AM   #7
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by knc1 View Post
Plan B:
Submit bug report to BR project about ld.so rpath tokens in 'Target Linker Options' being expanded to internal values. (Done.)

Build and use patchelf on the BR generated system libraries.
Plan B wins.

The Buildroot variable $O is part of the vary basic structure of the build system, there is no escaping it in the ld.so token: $ORIGIN.

The answer:
Build with an un-modified Buildroot, use patchelf as required on the resulting binaries.
Ref: https://github.com/NixOS/patchelf

Progress Note:
After 14 hours of beating head against wall (wall being the glibc-2.19 multi-lib loader) -
This is the best I have come up with for its search behavior:
Code:
[root@kindle bin]# LD_DEBUG=libs ./busybox
     17626:     find library=libc.so.6 [0]; searching
     17626:      search path=/mnt/us/extensions/system/lib/tls/v7l/neon/vfp:/mnt/us/extensions/system/lib/tls/v7l/neon:/mnt/us/extensions/system/lib/tls/v7l/vfp:/mnt/us/extensions/system/lib/tls/v7l:/mnt/us/extensions/system/lib/tls/neon/vfp:/mnt/us/extensions/system/lib/tls/neon:/mnt/us/extensions/system/lib/tls/vfp:/mnt/us/extensions/system/lib/tls:/mnt/us/extensions/system/lib/v7l/neon/vfp:/mnt/us/extensions/system/lib/v7l/neon:/mnt/us/extensions/system/lib/v7l/vfp:/mnt/us/extensions/system/lib/v7l:/mnt/us/extensions/system/lib/neon/vfp:/mnt/us/extensions/system/lib/neon:/mnt/us/extensions/system/lib/vfp:/mnt/us/extensions/system/lib            (RUNPATH from file ./busybox)
     17626:       trying file=/mnt/us/extensions/system/lib/tls/v7l/neon/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/v7l/neon/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/v7l/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/v7l/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/neon/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/neon/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/tls/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/v7l/neon/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/v7l/neon/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/v7l/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/v7l/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/neon/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/neon/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/vfp/libc.so.6
     17626:       trying file=/mnt/us/extensions/system/lib/libc.so.6
     17626:     
     17626:     
     17626:     calling init: /mnt/us/extensions/system/lib/libc.so.6
     17626:     
     17626:     
     17626:     calling init: /usr/lib/libenvload.so
     17626:     
     17626:     
     17626:     initialize program: ./busybox
     17626:     
     17626:     
     17626:     transferring control: ./busybox
     17626:     
BusyBox v1.22.1 (2014-06-08 17:55:06 CDT) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2012.
Licensed under GPLv2. See source distribution for detailed
copyright notices.

Usage: busybox [function [arguments]...]
   or: busybox --list[-full]
   or: busybox --install [-s] [DIR]
   or: function [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  Most people will create a
        link to busybox for each function they wish to use and BusyBox
        will act like whatever it was invoked as.

Currently defined functions:
        [, [[, addgroup, adduser, ar, arping, ash, awk, basename, blkid, bunzip2, bzcat, cat, catv, chattr, chgrp, chmod, chown, chroot, chrt, chvt, cksum, clear, cmp,
        cp, cpio, crond, crontab, cut, date, dc, dd, deallocvt, delgroup, deluser, devmem, df, diff, dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap, echo,
        egrep, eject, env, ether-wake, expr, false, fdflush, fdformat, fgrep, find, fold, free, freeramdisk, fsck, fstrim, fuser, getopt, getty, grep, gunzip, gzip,
        halt, hdparm, head, hexdump, hostid, hostname, hwclock, id, ifconfig, ifdown, ifup, inetd, init, insmod, install, ip, ipaddr, ipcrm, ipcs, iplink, iproute,
        iprule, iptunnel, kill, killall, killall5, klogd, last, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, losetup, ls, lsattr,
        lsmod, lsof, lspci, lsusb, lzcat, lzma, makedevs, md5sum, mdev, mesg, microcom, mkdir, mkfifo, mknod, mkswap, mktemp, modprobe, more, mount, mountpoint, mt, mv,
        nameif, netstat, nice, nohup, nslookup, od, openvt, passwd, patch, pidof, ping, pipe_progress, pivot_root, poweroff, printenv, printf, ps, pwd, rdate, readlink,
        readprofile, realpath, reboot, renice, reset, resize, rm, rmdir, rmmod, route, run-parts, runlevel, sed, seq, setarch, setconsole, setkeycodes, setlogcons,
        setserial, setsid, sh, sha1sum, sha256sum, sha3sum, sha512sum, sleep, sort, start-stop-daemon, strings, stty, su, sulogin, swapoff, swapon, switch_root, sync,
        sysctl, syslogd, tail, tar, tee, telnet, test, tftp, time, top, touch, tr, traceroute, true, tty, udhcpc, umount, uname, uniq, unix2dos, unlzma, unxz, unzip,
        uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, watch, watchdog, wc, wget, which, who, whoami, xargs, xz, xzcat, yes, zcat

     17626:     
     17626:     calling fini: ./busybox [0]
     17626:     
     17626:     
     17626:     calling fini: /usr/lib/libenvload.so [0]
     17626:     
[root@kindle bin]#
Those first 15 of the 16 look-up locations are the gnu-glibc people's idea of where we should be putting our libc. At least they are all in our */extensions/system/lib tree.
#16 is where I actually put it (and told the loader to look there).

Last edited by knc1; 06-08-2014 at 09:07 PM.
knc1 is offline   Reply With Quote
Old 06-08-2014, 09:39 AM   #8
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Tiny nitpick about #6: I think you meant -l, not -L, the uppercase one is for tweaking the link time libdir searchpath . (like what -I does for headers at compile time).

Neat idea to use linker scripts though, especially if the dynamic loader can be coerced into parsing those .

Last edited by NiLuJe; 06-12-2014 at 10:53 AM.
NiLuJe is offline   Reply With Quote
Old 06-09-2014, 10:16 AM   #9
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
PatchElf for I386 - Details

No way out of it - this is a "must have" utility.
Until Buildroot can create a host-patchelf utility, here is a hand built version.

This build passes all of its own self-tests.

Ref:
http://nixos.org/patchelf.html
https://github.com/NixOS/patchelf/archive/0.8.zip

Repo:
git clone https://github.com/NixOS/patchelf.git patchelf.git

Short description:
Code:
core2quad src $ file /usr/local/bin/patchelf
/usr/local/bin/patchelf: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
Archive contents (you need to sudo the unpacking in /usr/local):
Code:
cd /usr/local
tar --create --gzip --file=patchelf-0.8.tar.gz \
share/doc/patchelf/README \
share/man/man1/patchelf.1 \
bin/patchelf
More than you ever wanted to know:
Spoiler:

Code:
core2quad src $ readelf -dlh patchelf
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 03 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - GNU
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Intel 80386
  Version:                           0x1
  Entry point address:               0x804a0a8
  Start of program headers:          52 (bytes into file)
  Start of section headers:          577336 (bytes into file)
  Flags:                             0x0
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         9
  Size of section headers:           40 (bytes)
  Number of section headers:         39
  Section header string table index: 36

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  PHDR           0x000034 0x08048034 0x08048034 0x00120 0x00120 R E 0x4
  INTERP         0x000154 0x08048154 0x08048154 0x00013 0x00013 R   0x1
      [Requesting program interpreter: /lib/ld-linux.so.2]
  LOAD           0x000000 0x08048000 0x08048000 0x16da0 0x16da0 R E 0x1000
  LOAD           0x016ef0 0x0805fef0 0x0805fef0 0x00208 0x002e4 RW  0x1000
  DYNAMIC        0x016f08 0x0805ff08 0x0805ff08 0x000e8 0x000e8 RW  0x4
  NOTE           0x000168 0x08048168 0x08048168 0x00044 0x00044 R   0x4
  GNU_EH_FRAME   0x014534 0x0805c534 0x0805c534 0x0039c 0x0039c R   0x4
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4
  GNU_RELRO      0x016ef0 0x0805fef0 0x0805fef0 0x00110 0x00110 R   0x1

 Section to Segment mapping:
  Segment Sections...
   00     
   01     .interp 
   02     .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame .gcc_except_table 
   03     .init_array .ctors .dtors .jcr .dynamic .got .got.plt .data .bss 
   04     .dynamic 
   05     .note.ABI-tag .note.gnu.build-id 
   06     .eh_frame_hdr 
   07     
   08     .init_array .ctors .dtors .jcr .dynamic .got 

Dynamic section at offset 0x16f08 contains 24 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000c (INIT)                       0x8048e44
 0x0000000d (FINI)                       0x805ae2c
 0x00000019 (INIT_ARRAY)                 0x805fef0
 0x0000001b (INIT_ARRAYSZ)               4 (bytes)
 0x6ffffef5 (GNU_HASH)                   0x80481ac
 0x00000005 (STRTAB)                     0x804862c
 0x00000006 (SYMTAB)                     0x80481ec
 0x0000000a (STRSZ)                      1270 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000015 (DEBUG)                      0x0
 0x00000003 (PLTGOT)                     0x805fff4
 0x00000002 (PLTRELSZ)                   480 (bytes)
 0x00000014 (PLTREL)                     REL
 0x00000017 (JMPREL)                     0x8048c64
 0x00000011 (REL)                        0x8048c4c
 0x00000012 (RELSZ)                      24 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x6ffffffe (VERNEED)                    0x8048bac
 0x6fffffff (VERNEEDNUM)                 3
 0x6ffffff0 (VERSYM)                     0x8048b22
 0x00000000 (NULL)                       0x0


Find the most recent build attached at post #1 of this thread.

Last edited by knc1; 06-09-2014 at 10:20 AM.
knc1 is offline   Reply With Quote
Old 06-10-2014, 12:09 AM   #10
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by NiLuJe View Post
Tiny nitpick about #6: I think you meant -l, not -L, the uppercase one is for tweaking the link time libdir searchpath . (like what -I does for headers at compile time).

Neat idea to use linker scripts though, especially if the dynamic loader can be coerced into parsing those .
That dynamic linker code is some of the most difficult to understand "C" programming I have seen in a long time.

"Enhancing" that thing will have to wait.
Too much time for too little result - will just "make do" for now.
knc1 is offline   Reply With Quote
Old 06-10-2014, 08:06 PM   #11
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Possibly the most awesome post I have read in months.
Okay the only post I have read in months, and it is awesome.

Amazing work.
twobob is offline   Reply With Quote
Old 06-10-2014, 09:37 PM   #12
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Thanks.
And welcome back.
Glad to see that "life" has let you have some hobby time again.

- - - -

In other news (about the missing):
https://www.mobileread.com/forums/sho...&postcount=901
knc1 is offline   Reply With Quote
Old 06-10-2014, 10:25 PM   #13
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
hah... classic tunes.

Yeah. life. sure does stomp all over you when you least expect it.

I'm going to get a raspberry pi tomorrow to test out the hardfloat stuff. if that helps any?
twobob is offline   Reply With Quote
Old 06-10-2014, 10:47 PM   #14
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by twobob View Post
hah... classic tunes.

Yeah. life. sure does stomp all over you when you least expect it.

I'm going to get a raspberry pi tomorrow to test out the hardfloat stuff. if that helps any?
BR 2014.05 was released with 2 failures found by the auto-builders (and those where fixed in the release).

You will find a lot of support for Rpi has been added.
Members from two of the commercial users of BR are pushing a lot of that support into the tree.
knc1 is offline   Reply With Quote
Old 06-10-2014, 10:57 PM   #15
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
excellent.

it's silly o clock here so time to collapse.

will give that a once over then. thank knc1. you are , eternally, the man.
twobob is offline   Reply With Quote
Reply

Tags
armhf

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle Nicknaming Scheme, Using Kindle with Calibre, and Hacking the Kindle Klif Amazon Kindle 11 09-12-2012 05:11 PM
$0.01 in Kindle Store: Interactive Sudoku for Kindle 2 and Kindle DX - Volume 1 Xia Deals and Resources (No Self-Promotion or Affiliate Links) 2 11-07-2009 10:06 AM


All times are GMT -4. The time now is 01:10 PM.


MobileRead.com is a privately owned, operated and funded community.