binutils-gdb/libctf
Nick Alcock 2ba5ec13b2 libctf: fix name lookup in dicts containing base-type bitfields
The intent of the name lookup code was for lookups to yield non-bitfield
basic types except if none existed with a given name, and only then
return bitfield types with that name.  Unfortunately, the code as
written only does this if the base type has a type ID higher than all
bitfield types, which is most unlikely (the opposite is almost always
the case).

Adjust it so that what ends up in the name table is the highest-width
zero-offset type with a given name, if any such exist, and failing that
the first type with that name we see, no matter its offset.  (We don't
define *which* bitfield type you get, after all, so we might as well
just stuff in the first we find.)

Reported by Stephen Brennan <stephen.brennan@oracle.com>.

libctf/

	* ctf-open.c (init_types): Modify to allow some lookups during open;
	detect bitfield name reuse and prefer less bitfieldy types.
	* testsuite/libctf-writable/libctf-bitfield-name-lookup.*: New test.
2024-04-19 16:14:46 +01:00
..
doc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
testsuite libctf: fix name lookup in dicts containing base-type bitfields 2024-04-19 16:14:46 +01:00
.gitignore libctf: restructure error handling to reduce relocations 2020-07-22 17:57:20 +01:00
aclocal.m4 mmap: Avoid the sanitizer configure check failure 2024-04-10 03:57:46 -07:00
ChangeLog Add markers for 2.42 branch 2024-01-15 14:42:15 +00:00
ChangeLog-2020 libctf: fix old ChangeLog typo 2021-01-05 14:53:40 +00:00
config.h.in Finalized intl-update patches 2023-11-15 12:53:04 +00:00
configure mmap: Avoid the sanitizer configure check failure 2024-04-10 03:57:46 -07:00
configure.ac mmap: Avoid the sanitizer configure check failure 2024-04-10 03:57:46 -07:00
ctf-archive.c libctf: don't leak the symbol name in the name->type cache 2024-04-19 16:14:45 +01:00
ctf-create.c libctf: remove static/dynamic name lookup distinction 2024-04-19 16:14:46 +01:00
ctf-decl.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-decls.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-dedup.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-dump.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-endian.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-error.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-hash.c libctf: remove static/dynamic name lookup distinction 2024-04-19 16:14:46 +01:00
ctf-impl.h libctf: remove static/dynamic name lookup distinction 2024-04-19 16:14:46 +01:00
ctf-inlines.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-intl.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-labels.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-link.c libctf warnings 2024-04-17 09:24:36 +09:30
ctf-lookup.c libctf: remove static/dynamic name lookup distinction 2024-04-19 16:14:46 +01:00
ctf-open-bfd.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-open.c libctf: fix name lookup in dicts containing base-type bitfields 2024-04-19 16:14:46 +01:00
ctf-qsort_r.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-serialize.c libctf: remove static/dynamic name lookup distinction 2024-04-19 16:14:46 +01:00
ctf-sha1.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-sha1.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-string.c libctf: remove static/dynamic name lookup distinction 2024-04-19 16:14:46 +01:00
ctf-subr.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf-types.c libctf: remove static/dynamic name lookup distinction 2024-04-19 16:14:46 +01:00
ctf-util.c Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elf.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
libctf.ver Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
Makefile.am Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
Makefile.in mmap: Avoid the sanitizer configure check failure 2024-04-10 03:57:46 -07:00
NEWS include, libctf, ld: extend variable section to contain functions too 2022-03-23 13:48:32 +00:00
swap.h libctf warnings 2024-04-17 09:24:36 +09:30