diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2020-11-20 13:34:04 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2020-11-20 13:34:05 +0000 |
commit | ae41200ba807f4342ae7ea5334a29cd6f519b02c (patch) | |
tree | 8f07eb4181e8e20ad4b91c0497fcae48252901d8 /binutils | |
parent | 139633c307eb6f5746ea04f94a0b6382e51bccb9 (diff) | |
download | fsf-binutils-gdb-ae41200ba807f4342ae7ea5334a29cd6f519b02c.zip fsf-binutils-gdb-ae41200ba807f4342ae7ea5334a29cd6f519b02c.tar.gz fsf-binutils-gdb-ae41200ba807f4342ae7ea5334a29cd6f519b02c.tar.bz2 |
libctf, include, binutils, gdb: rename CTF-opening functions
The functions that return ctf_dict_t's given a ctf_archive_t and a name
are very clumsily named. It sounds like they return *archives*, not
dictionaries, and the names are very long and clunky. Why do we
have a ctf_arc_open_by_name when it opens a dictionary, not an archive,
and when there is no way to open a dictionary in any other way? The
answer is purely internal: the function is located in ctf-archive.c,
and everything in there was called ctf_arc_*, and there is another
way to open a dict (by offset in the archive), that is internal to
ctf-archive.c and that nothing else can call.
This is clearly bad naming. The internal organization of the source tree
should not dictate public API names!
So rename things (keeping the old, bad names for compatibility), and
adjust all users. You now open a dict using ctf_dict_open, and
open it giving ELF sections via ctf_dict_open_sections.
binutils/ChangeLog
2020-11-20 Nick Alcock <nick.alcock@oracle.com>
* objdump.c (dump_ctf): Use ctf_dict_open, not
ctf_arc_open_by_name.
* readelf.c (dump_section_as_ctf): Likewise.
gdb/ChangeLog
2020-11-20 Nick Alcock <nick.alcock@oracle.com>
* ctfread.c (elfctf_build_psymtabs): Use ctf_dict_open, not
ctf_arc_open_by_name.
include/ChangeLog
2020-11-20 Nick Alcock <nick.alcock@oracle.com>
* ctf-api.h (ctf_arc_open_by_name): Rename to...
(ctf_dict_open): ... this, keeping compatibility function.
(ctf_arc_open_by_name_sections): Rename to...
(ctf_dict_open_sections): ... this, keeping compatibility function.
libctf/ChangeLog
2020-11-20 Nick Alcock <nick.alcock@oracle.com>
* ctf-archive.c (ctf_arc_open_by_offset): Rename to...
(ctf_dict_open_by_offset): ... this. Adjust callers.
(ctf_arc_open_by_name_internal): Rename to...
(ctf_dict_open_internal): ... this. Adjust callers.
(ctf_arc_open_by_name_sections): Rename to...
(ctf_dict_open_sections): ... this, keeping compatibility function.
(ctf_arc_open_by_name): Rename to...
(ctf_dict_open): ... this, keeping compatibility function.
* libctf.ver: New functions added.
* ctf-link.c (ctf_link_one_input_archive): Adjusted accordingly.
(ctf_link_deduplicating_open_inputs): Likewise.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 6 | ||||
-rw-r--r-- | binutils/objdump.c | 2 | ||||
-rw-r--r-- | binutils/readelf.c | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index e1a5a3d..8b7cba0 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,11 @@ 2020-11-20 Nick Alcock <nick.alcock@oracle.com> + * objdump.c (dump_ctf): Use ctf_dict_open, not + ctf_arc_open_by_name. + * readelf.c (dump_section_as_ctf): Likewise. + +2020-11-20 Nick Alcock <nick.alcock@oracle.com> + * objdump.c (dump_ctf_errs): Rename ctf_file_t to ctf_dict_t. (dump_ctf_archive_member): Likewise. (dump_ctf): Likewise. Use ctf_dict_close, not ctf_file_close. diff --git a/binutils/objdump.c b/binutils/objdump.c index 54f4081..bf82349 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -4194,7 +4194,7 @@ dump_ctf (bfd *abfd, const char *sect_name, const char *parent_name) /* Assume that the applicable parent archive member is the default one. (This is what all known implementations are expected to do, if they put CTFs and their parents in archives together.) */ - if ((parent = ctf_arc_open_by_name (lookparent, NULL, &err)) == NULL) + if ((parent = ctf_dict_open (lookparent, NULL, &err)) == NULL) { dump_ctf_errs (NULL); non_fatal (_("CTF open failure: %s"), ctf_errmsg (err)); diff --git a/binutils/readelf.c b/binutils/readelf.c index e3b9f6f..a79f295 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -14775,7 +14775,7 @@ dump_section_as_ctf (Elf_Internal_Shdr * section, Filedata * filedata) /* Assume that the applicable parent archive member is the default one. (This is what all known implementations are expected to do, if they put CTFs and their parents in archives together.) */ - if ((parent = ctf_arc_open_by_name (lookparent, NULL, &err)) == NULL) + if ((parent = ctf_dict_open (lookparent, NULL, &err)) == NULL) { dump_ctf_errs (NULL); error (_("CTF open failure: %s\n"), ctf_errmsg (err)); |