I guess for some reasons your GDB found wrong (64-bit) library for your 32-bit
program. See the settings like `set solib-search-path', `set sysroot' etc.
I have two questions:
1. is tweaking extract_typed_address() the right way to handle 32
bit addresses on a 64 bit machine?
No. If ARCH_SIZE and TARGET_GDBARCH are set right it will work.
2. what's going wrong with dl_main()?
There is called a notification new library has been loaded in the inferior,
therefore GDB tries to load a matching symbol file (=the library itself) on
the GDB side.
3. meta-question: is this a generic bug in gdb's handling of 32 bit
binaries, or is there likely something I missed while porting?
It 32-on-64 normally works, at least in Fedora, no custom patches for it
there.
Regards,
Jan