Subject: bug#34180: 27.0.50; argv[0] used incorrectly to find the .pdmp

From: Stefan Monnier <[email-masked]>
Date: Mon, 11 Oct 2021 20:51:31 -0400

> It's not quite that simple though. The pdmp file includes offsets of data
> structures within the Emacs executable. Rebuilding the executable with a big
> char array will change these offsets and invalidate the pdmp blob you're
> trying to embed. Now, you could try to guess the size of the blob ahead of
> time, include a dummy embedded array of that size in Emacs, dump, and then
> overwrite the embedded array post-build, but there's no guarantee that doing
> that would actually work on all systems.

Maybe we could avoid this problem by moving most of the Emacs executable
to a shared library, so the Emacs executable would be just a `dump`
variable and ` main` function which passes it to an entry point provided
by libemacs<fingerpring>.so`.

I'm not sure I like the idea of building a shared lib and the extra
complexity of making sure the Emacs executable finds it.

        Stefan