Let me count the ways... (this is unexelf.c: the non-ELF unexecs are rather neater, probably because they don't need to cater for the requirements of more than one platform).
... dependency on section names and ordering. Dependency on symbol names (it knows the name of the sole symbol in a special object file linked in last of all). Inverse runtime linking, with a short, ugly, and inadequate hardwired list of relocations. Massive platform-specific ifdeffery. Special-cases throughout the source code for things that will be dumped into the executable and stay read-only ('pure space') versus those that will not. All the signs of code that was neat when it was written (if you believe the (C), in 1985) but has evolved since then in the ugliest imaginable fashion.
Quite like a lot of the rest of the insides of Emacs, really. (Parts of it are neater. None is uglier.)
Ew, I shouldn't have looked at that so early in the morning. I feel quite queasy now.