Skip to content

Unable to find libm.so with GNU ld script #17

@yashi

Description

@yashi

On Debian Sid with libc6:amd64 2.33-7, libm.so is a GNU ld script just like the following. With this, libwhich libm.so doesn't find the actual libm binary.

$ git rev-parse HEAD
87cffe10080c98e7b5786c5166e420bf1ada1d41

$ ./libwhich libm.so
failed to open library: /lib/x86_64-linux-gnu/libm.so: invalid ELF header

But, does find it when I append .6.

$ ./libwhich libm.so.6
library:
  /lib/x86_64-linux-gnu/libm.so.6

dependencies:
  linux-vdso.so.1
  /lib/x86_64-linux-gnu/libdl.so.2
  /lib/x86_64-linux-gnu/libc.so.6
  /lib64/ld-linux-x86-64.so.2
+ /lib/x86_64-linux-gnu/libm.so.6
$ cat /lib/x86_64-linux-gnu/libm.so
/* GNU ld script
*/
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib/x86_64-linux-gnu/libm.so.6  AS_NEEDED ( /lib/x86_64-linux-gnu/libmvec.so.1 ) )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions