In article <up190l$313qt$
[email protected]>,
Lawrence D'Oliveiro <
[email protected]d> wrote:
On Fri, 26 Jan 2024 13:39:45 -0000 (UTC), Kenny McCormack wrote:
I have a program that is both an executable and a shared library. I
compile it with -fpic and -pie on x86/64. When run, it sets LD_PRELOAD to >> itself, then runs another program (such that LD_PRELOAD kicks in - sort of >> a "call back"). When originally developed, this all worked fine. And it
still works on the development system.
Seems this kind of thing never worked right, and was explicitly
disabled a while back ><https://patchwork.ozlabs.org/project/glibc/patch/[email protected]/>
(found from ><https://stackoverflow.com/questions/59074126/loading-executable-or-executing-a-library>).
OK, so it *is* tied to version of glibc. Thanks.
That explains why it works on the older system, but fails on a newer one.
And not really a Ubuntu thing - more of a "Red Hat" thing.
P.S. Good read on stackoverflow. Good to see at least some people
refusing to drink the Kool Aid.
Anyway, it does sound like it boils down to needing to compile the program twice - once as shared lib and once as executable. Not as convenient as before, but so it goes. It makes you wish that there was some way to
"bundle" the two outputs together into a single file - sort of like how
other, more complex filesystems (e.g., the old MacOS) worked.
But so it goes...
files - one compiled
--
Just remember:
Pence is all the evil, with none of the crazy.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)