guys
i’m using the latest Manjaro KDE.
-
i complied a 32bit asm with below options:
bubble: bubble.o ld -m elf_i386 -L /usr/lib32 -lc -dynamic-linker /lib/ld-linux.so.2 -o $@ $^ bubble.o: bubble.s as -32 -o $@ $<
-
I successfully get the binary ‘bubble’ as below
[ethan@ethan-fisher asm]$ file bubble bubble: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, not stripped
-
but everytime when i run this binary, it complains below error, but still get right result:
ERROR: ld.so: object '/usr/lib/libutil.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
-
ldd output as below
[ethan@ethan-fisher asm]$ ldd bubble ERROR: ld.so: object '/usr/lib/libutil.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. linux-gate.so.1 (0xf7fc7000) libc.so.6 => /usr/lib32/libc.so.6 (0xf7da4000) /lib/ld-linux.so.2 => /usr/lib/ld-linux.so.2 (0xf7fc9000) [ethan@ethan-fisher asm]$
-
i tried to manually link /usr/lib/libutil.so (linked to /usr/lib/libutil-2.33.so) to /usr/lib32/libutil-2.33.so, the error complaint disappear when i run same binary again. but this will cause other 64bit applications (such as ‘ls’) complains the same error, because the libutil.so became 32bit.
so, my questions is: how to configure the system or gcc runtime suites to automatically enable:
64bit ld-linux.so to link or use /usr/lib/libutil-2.33.so, while
32bit ld-linux.so to link or use /usr/lib32/libutil-2.33.so
much appreciated…
Ethan.