aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2024-07-15 23:25:25 +0100
committerNick Alcock <nick.alcock@oracle.com>2024-08-01 14:30:21 +0100
commitb964314b292aa4378a555864b22517fd55049246 (patch)
tree1b2d97c18694738409f45b3efdb657afe32e0885
parent0eea22de3852ba0fe61ccb012936f67713120a6d (diff)
downloadgdb-b964314b292aa4378a555864b22517fd55049246.zip
gdb-b964314b292aa4378a555864b22517fd55049246.tar.gz
gdb-b964314b292aa4378a555864b22517fd55049246.tar.bz2
libctf: link: remember to turn off the LCTF_LINKING flag after ctf_link_write
We set this flag at the top of ctf_link_write (to tell ctf_serialize, way down under the archive file writing functions, to do the various link- time serialization things like symbol filtering and the like), but we never remember to clear it except on error. This is probably bad if you want to serialize the dict yourself directly in the future after linking it (which is... definitely a *possible* use of the API, if rather strange). libctf/ * ctf-link.c (ctf_link_write): Clear LCTF_LINKING before exit.
-rw-r--r--libctf/ctf-link.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libctf/ctf-link.c b/libctf/ctf-link.c
index 7b68d70..3bfc36e 100644
--- a/libctf/ctf-link.c
+++ b/libctf/ctf-link.c
@@ -2040,6 +2040,10 @@ ctf_link_write (ctf_dict_t *fp, size_t *size, size_t threshold)
goto err_no;
}
+ /* Turn off the is-linking flag on all the dicts in this link. */
+ for (i = 0; i < arg.i; i++)
+ arg.files[i]->ctf_flags &= ~LCTF_LINKING;
+
*size = fsize;
free (arg.names);
free (arg.files);