>Synopsis:      modload (ld) issues on armv7 (beaglebone black)
>Category:      system, ld, kernel
>Environment:
        System      : OpenBSD 5.6
        Details     : OpenBSD 5.6-current (GENERIC-OMAP) #5: Thu Oct  9 
16:58:24 AEDT 2014
                         
[email protected]:/usr/src/sys/arch/armv7/compile/GENERIC-OMAP

        Architecture: OpenBSD.armv7
        Machine     : armv7
>Description:
        ld fails with internel error on lkm load:

        ld -nopie -Z -R /dev/ksyms -e test_lkmentry -o test -Ttext 0x0 
combined.o
        internal error: aborting at /usr/src/gnu/usr.bin/binutils/ld/ldlang.c 
line 3835 in lang_place_orphans
        ld: please report this bug

>How-To-Repeat:
        Suppose a simple LKM, wich does nothing, like:
        ---8<---
        /* header includes skipped */

        MOD_MISC("test");

        int
        test_lkmentry(struct lkm_table *lkmtp, int cmd, int ver)
        {
                DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc);
        }
        ---8<---

        It builds without problems:
        # make
        cc -O2 -pipe   -D_KERNEL -D_LKM -I/usr/src/sys -I/usr/src/sys/arch   -c 
test.c
        ld   -r -o combined.o test.o

        But when I try to load it, it fails:
        # make load
        cc -O2 -pipe   -D_KERNEL -D_LKM -I/usr/src/sys -I/usr/src/sys/arch   -c 
test.c
        ld   -r -o combined.o test.o 
        root/src/test/testinstall combined.o;  else  modload -d -o test - 
combined.o
        ld: internal error: aborting at /usr/src/gnu/usr.bin/'t prelink 
`combined.o' creating `test'
        *** Error 1 in /root/src/test (<bsd.lkm.mk>:100 'load')

        Same behavior with any other tested modules.

>Fix:
        unknown

        Same problem was reported back in 2006 for zaurus platform:
        https://marc.info/?l=openbsd-tech&m=113754851115751&w=2


dmesg:
OpenBSD 5.6-current (GENERIC-OMAP) #5: Thu Oct  9 16:58:24 AEDT 2014
    [email protected]:/usr/src/sys/arch/armv7/compile/GENERIC-OMAP
real mem  = 536870912 (512MB)
avail mem = 518766592 (494MB)
warning: no entropy supplied by boot loader
mainbus0 at root
cpu0 at mainbus0: ARM Cortex A8 R3 rev 2 (ARMv7 core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB(64b/l,4way) I-cache, 32KB(64b/l,4way) wr-back D-cache
omap0 at mainbus0: BeagleBone
prcm0 at omap0 rev 0.2
sitaracm0 at omap0: control module, rev 1.0
intc0 at omap0 rev 5.0
edma0 at omap0 rev 0.0
dmtimer0 at omap0 rev 3.1
dmtimer1 at omap0 rev 3.1
omdog0 at omap0 rev 0.1
omgpio0 at omap0: rev 0.1
gpio0 at omgpio0: 32 pins
omgpio1 at omap0: rev 0.1
gpio1 at omgpio1: 32 pins
omgpio2 at omap0: rev 0.1
gpio2 at omgpio2: 32 pins
omgpio3 at omap0: rev 0.1
gpio3 at omgpio3: 32 pins
omap0: device tiiic unit 0 not configured
omap0: device tiiic unit 1 not configured
omap0: device tiiic unit 2 not configured
ommmc0 at omap0
sdmmc0 at ommmc0
ommmc1 at omap0
sdmmc1 at ommmc1
com0 at omap0: ti16750, 64 byte fifo
com0: console
cpsw0 at omap0: version 1.12 (0), address c8:a0:30:ac:51:d9
ukphy0 at cpsw0 phy 0: Generic IEEE 802.3u media interface, rev. 1: OUI 
0x0001f0, model 0x000f
scsibus0 at sdmmc1: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <SD/MMC, Drive #01, > SCSI2 0/direct fixed
sd0: 1832MB, 512 bytes/sector, 3751936 sectors
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
boot device: sd0
root on sd0a (51412d739679c748.a) swap on sd0b dump on sd0b
WARNING: / was not properly unmounted
WARNING: CHECK AND RESET THE DATE!

usbdevs:
usbdevs: no USB controllers found

pcidump:

acpidump:

Reply via email to