2

I am just curious why nm complains:

File format not recognized

if I do:

$ nm /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.so
nm: /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.so: File format not recognized

However, same command can be executed successfully against the stock one /lib64/libstdc++.so.6

Cœur
  • 37,241
  • 25
  • 195
  • 267
HCSF
  • 2,387
  • 1
  • 14
  • 40

1 Answers1

2

It is not a shared library. It is a ld script used at compile-time and not run-time
cat /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.so

/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf64-x86-64)
INPUT ( /usr/lib64/libstdc++.so.6 -lstdc++_nonshared )

For OUTPUT_FORMAT and INPUT explanation : see https://sourceware.org/binutils/docs-2.32/ld/LD-Index.html#LD-Index

Stef1611
  • 1,978
  • 2
  • 11
  • 30
  • Thanks! A non related question (hope you don't mind) -- what's in libstdc++_noshared.a? Complement to `/usr/lib64/libstdc++.so.6` to provide the new features covered by GCC 8? – HCSF Mar 14 '19 at 03:30
  • 1
    @HCSF. It does not mind. I think you will find the answer here : https://stackoverflow.com/a/15602073/7462275. – Stef1611 Mar 14 '19 at 06:56
  • Never thought of the answer would come from that post. Thanks! – HCSF Mar 14 '19 at 11:23