c++ - Change ld-linux location -
c++ - Change ld-linux location -
i have find out load libraries, executable first opens /lib/ld-linux-x86-64.so.2. functionality regarding loading shared libraries (search in many paths, using rpath, etc) work after ld-linux loaded, because ld-linux implements these functionality.
it seemed me ld-linux.so location hardcoded in executable (invoking strings on executable reinforces theory). problem in linux distribution, compiler (g++) sets ld-linux location /lib/ld-linux-x86-64.so.2. while on ubuntu (which more popular) located @ /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2.
i wondering if can create executable looks ld-linux.so @ /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2(which nowadays in distro symbolic link).
try adding -wl,--dynamic-linker=/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 ldflags.
c++ linux gcc shared-libraries ld
Comments
Post a Comment