]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libctf: write CTF files to memory, and CTF archives to fds
authorNick Alcock <nick.alcock@oracle.com>
Sat, 13 Jul 2019 19:40:52 +0000 (20:40 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 23 Sep 2019 13:12:54 +0000 (14:12 +0100)
commit1ba0a754ad8c035eac5f7476002ca32b6fd560ec
treeac0bc5b2bc46cc112651009773e2a1dda404e309
parentec60a7667672d6ca249686e0b30f877b322d3fdd
libctf: write CTF files to memory, and CTF archives to fds

Before now, we've been able to write CTF files to gzFile descriptors or
fds, and CTF archives to named files only.

Make this a bit less irregular by allowing CTF archives to be written
to fds with the new function ctf_arc_write_fd: also allow CTF
files to be written to a new memory buffer via ctf_write_mem.

(It would be nice to complete things by adding a new function to write
CTF archives to memory, but this is too difficult to do given the short
time the linker is expected to be writing them out: we will transition
to a better format in format v4, though we will always support reading
CTF archives that are stored in .ctf sections.)

include/
* ctf-api.h (ctf_arc_write_fd): New.
(ctf_write_mem): Likewise.
(ctf_gzwrite): Spacing fix.

libctf/
* ctf-archive.c (ctf_arc_write): Split off, and reimplement in terms
of...
(ctf_arc_write_fd): ... this new function.
* ctf-create.c (ctf_write_mem): New.
include/ChangeLog
include/ctf-api.h
libctf/ChangeLog
libctf/ctf-archive.c
libctf/ctf-create.c