binutils-gdb/libctf
Nick Alcock 7d53105d6e libctf: link against libiberty before linking in libbfd or libctf-nobfd
This ensures that the CTF_LIBADD, which always contains at least this
when doing a shared link:

-L`pwd`/../libiberty/pic -liberty

appears in the link line before any requirements pulled in by libbfd.la,
which include -liberty but because it is install-time do not include the
-L`pwd`/../libiberty/pic portion (in an indirect dep like this, the path
comes from the libbfd.la file, and is an install path).  libiberty also
appears after libbfd in the link line by virtue of libctf-nobfd.la,
because libctf-nobfd has to follow libbfd in the link line, and that
needs symbols from libiberty too.

Without this, an installed liberty might well be pulled in by libbfd,
and if --enable-install-libiberty is not specified this libiberty might
be completely incompatible with what is being installed and break either
or boht of libbfd and libctf. (The specific problem observed here is
that bsearch_r was not present, but other problems might easily be
observed in future too.)

Because ld links against libctf, this has a tendency to break the system
linker at install time too, if installing with --prefix=/usr.  That's
quite unpleasant to recover from.

libctf/ChangeLog
2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	PR libctf/27360
	* Makefile.am (libctf_la_LIBADD): Link against libiberty
	before pulling in libbfd.la or pulling in libctf-nobfd.la.
	* Makefile.in: Regenerate.
2021-09-27 20:31:22 +01:00
..
testsuite CC_FOR_TARGET et al 2021-09-03 16:26:09 +09:30
.gitignore
aclocal.m4
ChangeLog libctf: link against libiberty before linking in libbfd or libctf-nobfd 2021-09-27 20:31:22 +01:00
ChangeLog-2020
config.h.in
configure haiku tidy 2021-09-03 11:45:58 +09:30
configure.ac libctf: fix ELF-in-BFD checks in the presence of ASAN 2021-03-25 16:32:51 +00:00
ctf-archive.c
ctf-create.c libctf, include: support an alternative encoding for nonrepresentable types 2021-05-06 09:30:59 +01:00
ctf-decl.c
ctf-decls.h
ctf-dedup.c Use htab_eq_string in libctf 2021-05-09 12:28:32 +09:30
ctf-dump.c
ctf-endian.h
ctf-error.c
ctf-hash.c Use htab_eq_string in libctf 2021-05-09 12:28:32 +09:30
ctf-impl.h Use htab_eq_string in libctf 2021-05-09 12:28:32 +09:30
ctf-inlines.h
ctf-intl.h
ctf-labels.c
ctf-link.c
ctf-lookup.c libctf: don't dereference out-of-bounds locations in the qualifier hashtab 2021-03-25 16:32:49 +00:00
ctf-open-bfd.c libctf: make ctf_bfdopen_ctfsect a debugger entry point 2021-03-25 16:32:49 +00:00
ctf-open.c ubsan: libctf: applying zero offset to null pointer 2021-09-03 11:45:58 +09:30
ctf-qsort_r.c
ctf-serialize.c libctf, serialize: functions with no args have a NULL dtd_vlen 2021-03-25 16:32:48 +00:00
ctf-sha1.c
ctf-sha1.h
ctf-string.c
ctf-subr.c
ctf-types.c libctf, include: support an alternative encoding for nonrepresentable types 2021-05-06 09:30:59 +01:00
ctf-util.c
elf.h
libctf.ver libctf, include: support an alternative encoding for nonrepresentable types 2021-05-06 09:30:59 +01:00
Makefile.am libctf: link against libiberty before linking in libbfd or libctf-nobfd 2021-09-27 20:31:22 +01:00
Makefile.in libctf: link against libiberty before linking in libbfd or libctf-nobfd 2021-09-27 20:31:22 +01:00
NEWS libctf, include: support an alternative encoding for nonrepresentable types 2021-05-06 09:30:59 +01:00
swap.h