Skip to content
This repository was archived by the owner on Jan 20, 2022. It is now read-only.
This repository was archived by the owner on Jan 20, 2022. It is now read-only.

ld.so is at a different path than on Linux #2635

@pwmarcz

Description

@pwmarcz

(As discussed in #2625).

  • Graphene mounts the dynamic linker under /lib/ld-linux-x86-64.so.2, together with other glibc libraries. However, Linux executables (for x86-64 and glibc) have the ELF interpreter path set to /lib64/ld-linux-x86-64.so.2.

  • Because of that, Graphene does not use the ELF interpreter path directly (as Linux does) but tries paths LD_LIBRARY_PATH (falling back to /lib:/lib64 if LD_LIBRARY_PATH is not set).

  • Unfortunately we cannot just mount the glibc libraries at /lib64, because that's where we mount system libraries (arch_libdir) under systems such as Fedora. (Under Debian/Ubuntu, the system libraries are at /lib/x86_64-linux-gnu/).

Is this a problem?

I think this behavior is not very harmful. Mostly, the interpreter search is needlessly complicated, and it's confusing why Graphene behaves differently than Linux. I'm not sure how (or if) to fix it.

Possible solutions

  • Keep this behavior, document and explain it (the reason is we want to keep our libraries separate from system ones and /lib is a convenient path).
  • Mount the runtime dir from at /lib, not /lib64... but what about Fedora?
  • Mount the individual glibc files at /lib64 so that they override system ones. Seems brittle.
  • Hardcode this interpreter path in LibOS (i.e. unconditionally replace /lib64/ld-linux-x86-64.so.2 with /lib/ld-linux-x86-64.so.2). After all, this is the only interpreter we currently support.
  • ???

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions