You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keeping metadata in a /usr/lib/meta hierarchy has its pros and cons. As an alternative, it should be possible to bundle the metadata with the output binary. I have prototyped some hacks which provide a basis for this, in my elftin repo (https://github.com/stephenrkell/elftin). More specifically, the "embed-loadable" example shows how to bundle an ELF file opaquely into a containing ELF file.
This embedded ELF file can itself be a loadable .so file... this is directly loadable so long as the ld.so supports dlopening from a file descriptor. Sadly glibc's ld.so doesn't expose this, but internally it more-or-less implements it; elftin also has some non-robust hacks that make this work on a particular build of the now-outdated glibc 2.19 (in the ldso-helper.c file). The way to make this more robust, over multiple versions of glibc, is to use reflection on the ld.so itself. We already generate metadata for the ld.so; it is probably possible to use that to obtain the entry points we need, instead of the hacky offset-based code in ldso-helper.c.
The text was updated successfully, but these errors were encountered:
I'm no longer sure this is a good idea. If bundled, the meta-DSO would become opaque to an attached debugger, because it cannot be identified by a path in the filesystem.
Perhaps the right approach is on-demand creation of missing meta-DSOs? This could use debuginfod (#75).
Also, remember the idea of never bundling uniqtypes or other metadata into base (non-meta) DSOs (in #69), instead having then depend on the meta-DSO, perhaps using weak references and a DT_USEFUL extension. Could allocsld rewrite DT_USEFUL into DT_NEEDED or something ignorable, according to whether the meta-DSO is findable-or-generable?
Keeping metadata in a /usr/lib/meta hierarchy has its pros and cons. As an alternative, it should be possible to bundle the metadata with the output binary. I have prototyped some hacks which provide a basis for this, in my elftin repo (https://github.com/stephenrkell/elftin). More specifically, the "embed-loadable" example shows how to bundle an ELF file opaquely into a containing ELF file.
This embedded ELF file can itself be a loadable .so file... this is directly loadable so long as the ld.so supports dlopening from a file descriptor. Sadly glibc's ld.so doesn't expose this, but internally it more-or-less implements it; elftin also has some non-robust hacks that make this work on a particular build of the now-outdated glibc 2.19 (in the ldso-helper.c file). The way to make this more robust, over multiple versions of glibc, is to use reflection on the ld.so itself. We already generate metadata for the ld.so; it is probably possible to use that to obtain the entry points we need, instead of the hacky offset-based code in ldso-helper.c.
The text was updated successfully, but these errors were encountered: