If you don't want to use the memfd_create()+execl() you are going to parse the ELF header & friends yourself, fill in the correct locations, tables, segments, maps and system headers. Also needed is to do all the pre-cleaning the ELF loader does (related to the old/current process) before turning the execution over.
Basically you will be re-inventing the ELF loader. Unless you really need this (and don't want to create another binary format/loader/linker) I would suggest you use the memfd_create()+execl()
If you are brave enough (or has a specific requirement) here goes some more info. You can also take a look at an ELF packer source, just like you said, but most will likely re-implement an ELF loader alike thing. Good luck.