[PATCH] ld: depend on libctf

Stephen Casner casner@acm.org
Tue Jan 26 22:44:43 GMT 2021


On Tue, 26 Jan 2021, Nick Alcock via Binutils wrote:

> Since ld may depend on libctf (if present), and libctf may be relinked
> by the installation process, libctf must be installed before ld is,
> or the relink may fail if it calls on symbols or symbol versions that do
> not exist in any libctf already present on the system.  (If none is
> present, the copy in the build tree will be automatically used, but
> if one *is* present, it may take precedence and break things.)

I need to investigate complaints about the pdp11 port in a recent
commit but make of the full binutils ran into errors shown below
related to CTF when linking objdump.  I have now cloned a fresh copy
of binutils and applied your patch, but still get these errors.  In
case it is informative, here is my configure command:

/Users/casner/src/gnu/binutils/configure --target=pdp11-aout --prefix=/usr/local

                                                        -- Steve

ld: warning: ignoring file ../libctf/.libs/libctf.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture x86_64:
  "_ctf_archive_iter", referenced from:
      _dump_bfd in objdump.o
  "_ctf_bfdopen_ctfsect", referenced from:
      _dump_bfd in objdump.o
  "_ctf_close", referenced from:
      _dump_bfd in objdump.o
  "_ctf_dict_close", referenced from:
      _dump_bfd in objdump.o
  "_ctf_dict_open", referenced from:
      _dump_bfd in objdump.o
  "_ctf_dump", referenced from:
      _dump_ctf_archive_member in objdump.o
  "_ctf_errmsg", referenced from:
      _dump_bfd in objdump.o
      _dump_ctf_errs in objdump.o
      _dump_ctf_archive_member in objdump.o
  "_ctf_errno", referenced from:
      _dump_ctf_archive_member in objdump.o
  "_ctf_errwarning_next", referenced from:
      _dump_ctf_errs in objdump.o
  "_ctf_import", referenced from:
      _dump_ctf_archive_member in objdump.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


More information about the Binutils mailing list