hi i produced an executable that when i try to run it bash claims it's not real
@catoutofbed that's probably not bash claiming it then
multiple things can return the same errno
@catoutofbed run ldd on it
@iliana
what a badly named error then
@iliana
nope, i fixed that and it's a completely different error that's making bash error out
@catoutofbed errno(3) is a global variable that contains the last error, and the exec(3) family of functions returns errors like that
so *anything* in exec's path returning ENOENT causes bash to provide that error message
@catoutofbed you probably already knew that actually. hrm.
@catoutofbed anyway. how does ldd look now?
@catoutofbed given that ldd is probably an x86_64 executable, I would believe you
now run ldd on liblib.so
@catoutofbed why does a.out not list a dependency on ld-linux-x86-64.so.2?
@catoutofbed (also lol on my system ldd is a static binary. seems appropriate)
@iliana it's uh
it's a bash script on here?????
@catoutofbed oh christ it is a shell script
I always assumed...
# This is the `ldd' command, which lists what shared libraries are
# used by given dynamically-linked executables. It works by invoking the
# run-time dynamic linker as a command and setting the environment
# variable LD_TRACE_LOADED_OBJECTS to a non-empty value.
I hate computers
@iliana
they're pretty bad
@catoutofbed @iliana ban computers
@iliana oh, maybe ldd is just a bash script on solaris lol
@iliana
goooooood question
@catoutofbed what happens if you run
$ /usr/lib64/ld-linux-x86-64.so.2 ./a.out
@iliana segfault
which is probably on my end so i think we're running properly
@iliana so now the question of what the hell is ld doing that causes it to not link that
@iliana
so it gets weirder?
i tried invoking rustc with --crate-type=cdylib instead of dylib
now it's linking what appears to be correctly and yet????
@catoutofbed does ./a.out define _start?
@iliana
huh.....
how in the hell
i know what i'm linking with does?
weird thing is the elf header is valid except the entry point is at the top of the pheader for some reason?
@iliana
okay, now i've relinked and it does have _start in the symbol table
it seems that something is going srong in remapping /lib/ld64.so.1 to /usr/lib64/ld-linux-x86-64.so.2?
because ldd suggests that's what it's doing
but the executable doesn't load unless i manually specify that library?
@catoutofbed we have reached the limits of things I feel comfortable guessing about tbqh
good luck
@iliana
thanks for trying
there's plenty of stuff out there for calling into ffi from rust but not the other way around :\
@catoutofbed I guess I'm kind of confused as to what you're doing that would remap the 32-bit dynamic linker into the 64-bit one
that seems chaotic?
@iliana
i don't know what's doing that either tbqh
@iliana @catoutofbed ldd is a bash script
@catoutofbed @iliana apparently, writing is easier than reading, while drinking your very first coffee
hello, good morning, i'm a unix guru
@iliana