«wrong ELF class: ELFCLASS32», but only when using GDB
I’m trying to run dfhack in a debugger. I’m running 64-bit Ubuntu Trusty, but Dwarf Fortress does not have a 64-bit build so I’m running 32-bit Dwarf Fortress. I have installed gdb via apt-get install gdb:i386 . Here’s what happens when I start dfhack with gdb:
ben@australium:~/df_linux$ xvfb-run -a ./dfhack --gdb GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". Reading symbols from ./libs/Dwarf_Fortress. (no debugging symbols found). done. (gdb) start Temporary breakpoint 1 at 0x804bdec Starting program: /home/ben/df_linux/libs/Dwarf_Fortress ERROR: ld.so: object './hack/libdfhack.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1". Temporary breakpoint 1, 0xf7598b53 in main () from /home/ben/df_linux/libs/libgraphics.so (gdb)
ben@australium:~/df_linux$ xvfb-run -a ./dfhack Xlib: extension "RANDR" missing on display ":99". Loading bindings from data/init/interface.txt New window size: 1280x720 Font size: 10x12 Resizing grid to 128x60 Resizing font to 10x12 Resetting textures DFHack is ready. Have a nice day! Type in '?' or 'help' for general help, 'ls' to see all commands. [DFHack]#
ben@australium:~/df_linux$ readelf -h /home/ben/df_linux/libs/Dwarf_Fortress ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: Intel 80386 Version: 0x1 Entry point address: 0x804c980 Start of program headers: 52 (bytes into file) Start of section headers: 18192664 (bytes into file) Flags: 0x0 Size of this header: 52 (bytes) Size of program headers: 32 (bytes) Number of program headers: 8 Size of section headers: 40 (bytes) Number of section headers: 28 Section header string table index: 27 ben@australium:~/df_linux$ readelf -h /home/ben/df_linux/hack/libdfhack.so 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: DYN (Shared object file) Machine: Intel 80386 Version: 0x1 Entry point address: 0x1b7e40 Start of program headers: 52 (bytes into file) Start of section headers: 43686636 (bytes into file) Flags: 0x0 Size of this header: 52 (bytes) Size of program headers: 32 (bytes) Number of program headers: 7 Size of section headers: 40 (bytes) Number of section headers: 37 Section header string table index: 34 ben@australium:~/df_linux$ readelf -h /usr/bin/gdb ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: Intel 80386 Version: 0x1 Entry point address: 0x808cb95 Start of program headers: 52 (bytes into file) Start of section headers: 5089368 (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: 28 Section header string table index: 27
«error while loading shared libraries: libGL.so.1: wrong ELF class: ELFCLASS32» installing ATI drivers
I was following the instructions on section 3.2 of this page. Everything went well until step 8, which is to use sudo amdconfig —initial to create a new xorg.conf file, but I get the following error:
amdconfig: error while loading shared libraries: libGL.so.1: wrong ELF class: ELFCLASS32
I tried creating the file /etc/ld.so.conf.d/lib32.conf with /usr/lib32 inside, as the second answer here suggested, and ran sudo ldconfig but nothing changed. EDIT: Installed libgl1-mesa-glx:i386 and ran sudo ldconfig , and problem persisted even after rebooting. EDIT2: Since step seven of the first link, after rebooting my top and side panels of unity and also the dash are missing, but I’m assuming this will be fixed when I finish the drivers installation. EDIT3: Same error happens with fglrxinfo and glxinfo command (before following step 7 glx info was normal). EDIT4: output of lspci -v | grep -A10 VGA (complete output)
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) (prog-if 00 [VGA controller]) Subsystem: Dell Device 0572 Flags: bus master, fast devsel, latency 0, IRQ 45 Memory at c1000000 (64-bit, non-prefetchable) [size=4M] Memory at b0000000 (64-bit, prefetchable) [size=256M] I/O ports at 4000 [size=64] Expansion ROM at [disabled] Capabilities: Kernel driver in use: i915 01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Chelsea LP [Radeon HD 7730M] (prog-if 00 [VGA controller]) Subsystem: Dell Device 0572 Flags: bus master, fast devsel, latency 0, IRQ 16 Memory at a0000000 (64-bit, prefetchable) [size=256M] Memory at c0000000 (64-bit, non-prefetchable) [size=256K] I/O ports at 3000 [size=256] Expansion ROM at c0040000 [disabled] [size=128K] Capabilities: Kernel driver in use: fglrx_pci
libgl1-mesa-glx:amd64: /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 libgl1-mesa-glx:amd64: /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
Wrong elf class elfclass32 linux
10 июл. 2014 в 23:32
I’m running 64-bit Arch, so a few games don’t work for me since I have the newest versions of all the libraries, and most games are developed on ubuntu, which doesn’t.
But I don’t think that’s what’s breaking my game here. It’s either something wrong with Warband or with Steam. I get the following error message:
ERROR: ld.so: object ‘. /Steam/ubuntu12_32/gameoverlayrenderer.so’ from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
There are two ‘ubuntu’ directories in the Steam directory. One’s ubuntu12_32, and the other’s ubuntu12_64, which leads me to believe they contain 32 and 64-bit libraries respectively. If gameoverlayrenderer.so is in ubuntu12_32, then isn’t it supposed to be a 32-bit library (ELFCLASS32)?
11 июл. 2014 в 2:26
I doubt that this error it’s what cause your problem.
Any chance that you’re using AMD proprietary drivers?
11 июл. 2014 в 3:18
I think this is Arch specific, I am also experiencing this bug on Manjaro after the latest update on some games.
If this link sends you to the top of the page, you have to find the topic (2.14 Some games fail to start)
11 июл. 2014 в 3:50
You have this error with each game,i think it’s related to the steam overlay,if you are on 64bit,it’s say ELFCLASS32 and if you are on 32bit it’s say ELFCLASS64
It’s not really an error,i think it use the lib your system is on and tell the other is not working.
I’m running arch also and the game work fine with open source drivers but didn’t with catalyst.
11 июл. 2014 в 5:58
I can confirm this is an issue on Arch. I can also confirm that it really is not an issue and does not effect the game, nor overlay, in any noticable way when playing.
11 июл. 2014 в 10:46
I doubt that this error it’s what cause your problem.
Any chance that you’re using AMD proprietary drivers?
Yes, I’m using Catalyst. Is that a problem?
I don’t have this error with every game, though as I mention above, I’m using Catalyst. I already tried disabling the overlay for Warband. No effect.
I can confirm this is an issue on Arch. I can also confirm that it really is not an issue and does not effect the game, nor overlay, in any noticable way when playing.
11 июл. 2014 в 10:54
Yes, it’s exactly what cause your problem.
Game do not work with Catalyst at moment.
11 июл. 2014 в 11:00
11 июл. 2014 в 11:26
thanks for your guys’ help.
11 июл. 2014 в 11:31
Sorry it’s just typo. I mean videos doesn’t played for me on both AMD and Intel open source drivers, but game works just fine.
11 июл. 2014 в 12:37
I doubt that this error it’s what cause your problem.
Any chance that you’re using AMD proprietary drivers?
Yes, I’m using Catalyst. Is that a problem?
I don’t have this error with every game, though as I mention above, I’m using Catalyst. I already tried disabling the overlay for Warband. No effect.
I can confirm this is an issue on Arch. I can also confirm that it really is not an issue and does not effect the game, nor overlay, in any noticable way when playing.
Uhhh. no. When I start the game, it fails to load even the Paradox logo animation.
And I was reffering to the Steam Overlay errors not being an issue. Sorry should have made it a quote like this:
You have this error with each game,i think it’s related to the steam overlay,if you are on 64bit,it’s say ELFCLASS32 and if you are on 32bit it’s say ELFCLASS64
It’s not really an error,i think it use the lib your system is on and tell the other is not working.
I’m running arch also and the game work fine with open source drivers but didn’t with catalyst.
I can confirm this is an issue on Arch. I can also confirm that it really is not an issue and does not effect the game, nor overlay, in any noticable way when playing.
20 ноя. 2014 в 9:20
This is non-issue that appears on any 64 bit installation. That’s the linker complaining and ignoring the LD_PRELOAD, not the game.