ChangeLog-2020 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954
  1. 2020-09-23 H.J. Lu <hongjiu.lu@intel.com>
  2. PR libctf/26934
  3. * ctf-dump.c (ctf_dump_objts): Pass format argument to asprintf.
  4. 2020-11-23 Nick Alcock <nick.alcock@oracle.com>
  5. * ctf-impl.h (ctf_dict_t) <ctf_symtab_little_endian>: New.
  6. (struct ctf_archive_internal) <ctfi_symsect_little_endian>: Likewise.
  7. * ctf-create.c (ctf_serialize): Adjust for new field.
  8. * ctf-open.c (init_symtab): Note the semantics of repeated calls.
  9. (ctf_symsect_endianness): New.
  10. (ctf_bufopen_internal): Set ctf_symtab_little_endian suitably for
  11. the native endianness.
  12. (_Static_assert): Moved...
  13. (swap_thing): ... with this...
  14. * swap.h: ... to here.
  15. * ctf-util.c (ctf_elf32_to_link_sym): Use it, byteswapping the
  16. Elf32_Sym if the ctf_symtab_little_endian demands it.
  17. (ctf_elf64_to_link_sym): Likewise swap the Elf64_Sym if needed.
  18. * ctf-archive.c (ctf_arc_symsect_endianness): New, set the
  19. endianness of the symtab used by the dicts in an archive.
  20. (ctf_archive_iter_internal): Initialize to unknown (assumed native,
  21. do not call ctf_symsect_endianness).
  22. (ctf_dict_open_by_offset): Call ctf_symsect_endianness if need be.
  23. (ctf_dict_open_internal): Propagate the endianness down.
  24. (ctf_dict_open_sections): Likewise.
  25. * ctf-open-bfd.c (ctf_bfdopen_ctfsect): Get the endianness from the
  26. struct bfd and pass it down to the archive.
  27. * libctf.ver: Add ctf_symsect_endianness and
  28. ctf_arc_symsect_endianness.
  29. 2020-11-20 Nick Alcock <nick.alcock@oracle.com>
  30. * ctf-link.c (ctf_link_deduplicating): Clean up the ctf_link_outputs
  31. hash on error.
  32. 2020-11-20 Nick Alcock <nick.alcock@oracle.com>
  33. * ctf-create.c (ctf_dtd_insert): Set ENOMEM on the dict if out of memory.
  34. (ctf_dvd_insert): Likewise.
  35. (ctf_add_function): Report ECTF_RDONLY if this dict is not writable.
  36. * ctf-subr.c (ctf_err_warn): Only debug-dump passed-in warnings if
  37. the passed-in error code is nonzero: the error on the dict for
  38. warnings may relate to a previous error.
  39. 2020-11-20 Nick Alcock <nick.alcock@oracle.com>
  40. * ctf-open.c (ctf_getsymsect): New.
  41. (ctf_getstrsect): Likewise.
  42. * libctf.ver: Add them.
  43. 2020-11-20 Nick Alcock <nick.alcock@oracle.com>
  44. * ctf-impl.h (struct ctf_archive_internal) <ctfi_dicts>: New, dicts
  45. the archive machinery has opened and cached.
  46. <ctfi_symdicts>: New, cache of dicts containing symbols looked up.
  47. <ctfi_syms>: New, cache of types of symbols looked up.
  48. * ctf-archive.c (ctf_arc_close): Free them on close.
  49. (enosym): New, flag entry for 'symbol not present'.
  50. (ctf_arc_import_parent): New, automatically import the parent from
  51. ".ctf" if this is a child in an archive and ".ctf" is present.
  52. (ctf_dict_open_sections): Use it.
  53. (ctf_archive_iter_internal): Likewise.
  54. (ctf_cached_dict_close): New, thunk around ctf_dict_close.
  55. (ctf_dict_open_cached): New, open and cache a dict.
  56. (ctf_arc_flush_caches): New, flush the caches.
  57. (ctf_arc_lookup_symbol): New, look up a symbol in (all members of)
  58. an archive, and cache the lookup.
  59. (ctf_archive_iter): Note the new caching behaviour.
  60. (ctf_archive_next): Use ctf_dict_open_cached.
  61. * libctf.ver: Add ctf_arc_lookup_symbol and ctf_arc_flush_caches.
  62. 2020-11-20 Nick Alcock <nick.alcock@oracle.com>
  63. * ctf-dedup.c (ctf_dedup_rhash_type): Null out the names of nameless
  64. type kinds, just in case the input has named them.
  65. 2020-11-20 Nick Alcock <nick.alcock@oracle.com>
  66. * ctf-dump.c (ctf_dump_header): Dump the new flags bits and the index
  67. section lengths.
  68. (ctf_dump_objts): Report indexed sections. Also dump functions. Use
  69. ctf_symbol_next, not manual looping.
  70. (ctf_dump_funcs): Delete.
  71. (ctf_dump): Use ctf_dump_objts, not ctf_dump_funcs.
  72. 2020-11-20 Nick Alcock <nick.alcock@oracle.com>
  73. * ctf-impl.h (CTF_INDEX_PAD_THRESHOLD): New.
  74. (_libctf_nonnull_): Likewise.
  75. (ctf_in_flight_dynsym_t): New.
  76. (ctf_dict_t) <ctf_funcidx_names>: Likewise.
  77. <ctf_objtidx_names>: Likewise.
  78. <ctf_nfuncidx>: Likewise.
  79. <ctf_nobjtidx>: Likewise.
  80. <ctf_funcidx_sxlate>: Likewise.
  81. <ctf_objtidx_sxlate>: Likewise.
  82. <ctf_objthash>: Likewise.
  83. <ctf_funchash>: Likewise.
  84. <ctf_dynsyms>: Likewise.
  85. <ctf_dynsymidx>: Likewise.
  86. <ctf_dynsymmax>: Likewise.
  87. <ctf_in_flight_dynsym>: Likewise.
  88. (struct ctf_next) <u.ctn_next>: Likewise.
  89. (ctf_symtab_skippable): New prototype.
  90. (ctf_add_funcobjt_sym): Likewise.
  91. (ctf_dynhash_sort_by_name): Likewise.
  92. (ctf_sym_to_elf64): Rename to...
  93. (ctf_elf32_to_link_sym): ... this, and...
  94. (ctf_elf64_to_link_sym): ... this.
  95. * ctf-open.c (init_symtab): Check for lack of CTF_F_NEWFUNCINFO
  96. flag, and presence of index sections. Refactor out
  97. ctf_symtab_skippable and ctf_elf*_to_link_sym, and use them. Use
  98. ctf_link_sym_t, not Elf64_Sym. Skip initializing objt or func
  99. sxlate sections if corresponding index section is present. Adjust
  100. for new func info section format.
  101. (ctf_bufopen_internal): Add ctf_err_warn to corrupt-file error
  102. handling. Report incorrect-length index sections. Always do an
  103. init_symtab, even if there is no symtab section (there may be index
  104. sections still).
  105. (flip_objts): Adjust comment: func and objt sections are actually
  106. identical in structure now, no need to caveat.
  107. (ctf_dict_close): Free newly-added data structures.
  108. * ctf-create.c (ctf_create): Initialize them.
  109. (ctf_symtab_skippable): New, refactored out of
  110. init_symtab, with st_nameidx_set check added.
  111. (ctf_add_funcobjt_sym): New, add a function or object symbol to the
  112. ctf_objthash or ctf_funchash, by name.
  113. (ctf_add_objt_sym): Call it.
  114. (ctf_add_func_sym): Likewise.
  115. (symtypetab_delete_nonstatic_vars): New, delete vars also present as
  116. data objects.
  117. (CTF_SYMTYPETAB_EMIT_FUNCTION): New flag to symtypetab emitters:
  118. this is a function emission, not a data object emission.
  119. (CTF_SYMTYPETAB_EMIT_PAD): New flag to symtypetab emitters: emit
  120. pads for symbols with no type (only set for unindexed sections).
  121. (CTF_SYMTYPETAB_FORCE_INDEXED): New flag to symtypetab emitters:
  122. always emit indexed.
  123. (symtypetab_density): New, figure out section sizes.
  124. (emit_symtypetab): New, emit a symtypetab.
  125. (emit_symtypetab_index): New, emit a symtypetab index.
  126. (ctf_serialize): Call them, emitting suitably sorted symtypetab
  127. sections and indexes. Set suitable header flags. Copy over new
  128. fields.
  129. * ctf-hash.c (ctf_dynhash_sort_by_name): New, used to impose an
  130. order on symtypetab index sections.
  131. * ctf-link.c (ctf_add_type_mapping): Delete erroneous comment
  132. relating to code that was never committed.
  133. (ctf_link_one_variable): Improve variable name.
  134. (check_sym): New, symtypetab analogue of check_variable.
  135. (ctf_link_deduplicating_one_symtypetab): New.
  136. (ctf_link_deduplicating_syms): Likewise.
  137. (ctf_link_deduplicating): Call them.
  138. (ctf_link_deduplicating_per_cu): Note that we don't call them in
  139. this case (yet).
  140. (ctf_link_add_strtab): Set the error on the fp correctly.
  141. (ctf_link_add_linker_symbol): New (no longer a do-nothing stub), add
  142. a linker symbol to the in-flight list.
  143. (ctf_link_shuffle_syms): New (no longer a do-nothing stub), turn the
  144. in-flight list into a mapping we can use, now its names are
  145. resolvable in the external strtab.
  146. * ctf-string.c (ctf_str_rollback_atom): Don't roll back atoms with
  147. external strtab offsets.
  148. (ctf_str_rollback): Adjust comment.
  149. (ctf_str_write_strtab): Migrate ctf_syn_ext_strtab population from
  150. writeout time...
  151. (ctf_str_add_external): ... to string addition time.
  152. * ctf-lookup.c (ctf_lookup_var_key_t): Rename to...
  153. (ctf_lookup_idx_key_t): ... this, now we use it for syms too.
  154. <clik_names>: New member, a name table.
  155. (ctf_lookup_var): Adjust accordingly.
  156. (ctf_lookup_variable): Likewise.
  157. (ctf_lookup_by_id): Shuffle further up in the file.
  158. (ctf_symidx_sort_arg_cb): New, callback for...
  159. (sort_symidx_by_name): ... this new function to sort a symidx
  160. found to be unsorted (likely originating from the compiler).
  161. (ctf_symidx_sort): New, sort a symidx.
  162. (ctf_lookup_symbol_name): Support dynamic symbols with indexes
  163. provided by the linker. Use ctf_link_sym_t, not Elf64_Sym.
  164. Check the parent if a child lookup fails.
  165. (ctf_lookup_by_symbol): Likewise. Work for function symbols too.
  166. (ctf_symbol_next): New, iterate over symbols with types (without
  167. sorting).
  168. (ctf_lookup_idx_name): New, bsearch for symbol names in indexes.
  169. (ctf_try_lookup_indexed): New, attempt an indexed lookup.
  170. (ctf_func_info): Reimplement in terms of ctf_lookup_by_symbol.
  171. (ctf_func_args): Likewise.
  172. (ctf_get_dict): Move...
  173. * ctf-types.c (ctf_get_dict): ... here.
  174. * ctf-util.c (ctf_sym_to_elf64): Re-express as...
  175. (ctf_elf64_to_link_sym): ... this. Add new st_symidx field, and
  176. st_nameidx_set (always 0, so st_nameidx can be ignored). Look in
  177. the ELF strtab for names.
  178. (ctf_elf32_to_link_sym): Likewise, for Elf32_Sym.
  179. (ctf_next_destroy): Destroy ctf_next_t.u.ctn_next if need be.
  180. * libctf.ver: Add ctf_symbol_next, ctf_add_objt_sym and
  181. ctf_add_func_sym.
  182. 2020-11-20 Nick Alcock <nick.alcock@oracle.com>
  183. * ctf-link.c (ctf_link_shuffle_syms): Adjust.
  184. (ctf_link_add_linker_symbol): New, unimplemented stub.
  185. * libctf.ver: Add it.
  186. * ctf-create.c (ctf_serialize): Set CTF_F_DYNSTR on newly-serialized
  187. dicts.
  188. * ctf-open-bfd.c (ctf_bfdopen_ctfsect): Check for the flag: open the
  189. symtab/strtab if not present, dynsym/dynstr otherwise.
  190. * ctf-archive.c (ctf_arc_bufpreamble): New, get the preamble from
  191. some arbitrary member of a CTF archive.
  192. * ctf-impl.h (ctf_arc_bufpreamble): Declare it.
  193. 2020-11-20 Nick Alcock <nick.alcock@oracle.com>
  194. * ctf-archive.c (ctf_arc_open_by_offset): Rename to...
  195. (ctf_dict_open_by_offset): ... this. Adjust callers.
  196. (ctf_arc_open_by_name_internal): Rename to...
  197. (ctf_dict_open_internal): ... this. Adjust callers.
  198. (ctf_arc_open_by_name_sections): Rename to...
  199. (ctf_dict_open_sections): ... this, keeping compatibility function.
  200. (ctf_arc_open_by_name): Rename to...
  201. (ctf_dict_open): ... this, keeping compatibility function.
  202. * libctf.ver: New functions added.
  203. * ctf-link.c (ctf_link_one_input_archive): Adjusted accordingly.
  204. (ctf_link_deduplicating_open_inputs): Likewise.
  205. 2020-11-20 Nick Alcock <nick.alcock@oracle.com>
  206. * ctf-impl.h: Rename ctf_file_t to ctf_dict_t: all declarations
  207. adjusted.
  208. (ctf_fileops): Rename to...
  209. (ctf_dictops): ... this.
  210. (ctf_dedup_t) <cd_id_to_file_t>: Rename to...
  211. <cd_id_to_dict_t>: ... this.
  212. (ctf_file_t): Fix outdated comment.
  213. <ctf_fileops>: Rename to...
  214. <ctf_dictops>: ... this.
  215. (struct ctf_archive_internal) <ctfi_file>: Rename to...
  216. <ctfi_dict>: ... this.
  217. * ctf-archive.c: Rename ctf_file_t to ctf_dict_t.
  218. Rename ctf_archive.ctfa_nfiles to ctfa_ndicts.
  219. Rename ctf_file_close to ctf_dict_close. All users adjusted.
  220. * ctf-create.c: Likewise. Refer to CTF dicts, not CTF containers.
  221. (ctf_bundle_t) <ctb_file>: Rename to...
  222. <ctb_dict): ... this.
  223. * ctf-decl.c: Rename ctf_file_t to ctf_dict_t.
  224. * ctf-dedup.c: Likewise. Rename ctf_file_close to
  225. ctf_dict_close. Refer to CTF dicts, not CTF containers.
  226. * ctf-dump.c: Likewise.
  227. * ctf-error.c: Likewise.
  228. * ctf-hash.c: Likewise.
  229. * ctf-inlines.h: Likewise.
  230. * ctf-labels.c: Likewise.
  231. * ctf-link.c: Likewise.
  232. * ctf-lookup.c: Likewise.
  233. * ctf-open-bfd.c: Likewise.
  234. * ctf-string.c: Likewise.
  235. * ctf-subr.c: Likewise.
  236. * ctf-types.c: Likewise.
  237. * ctf-util.c: Likewise.
  238. * ctf-open.c: Likewise.
  239. (ctf_file_close): Rename to...
  240. (ctf_dict_close): ...this.
  241. (ctf_file_close): New trivial wrapper around ctf_dict_close, for
  242. compatibility.
  243. (ctf_parent_file): Rename to...
  244. (ctf_parent_dict): ... this.
  245. (ctf_parent_file): New trivial wrapper around ctf_parent_dict, for
  246. compatibility.
  247. * libctf.ver: Add ctf_dict_close and ctf_parent_dict.
  248. 2020-10-21 Tom Tromey <tromey@adacore.com>
  249. * mkerrors.sed: Remove.
  250. * ctf-error.c (_CTF_FIRST): New define.
  251. (_CTF_ITEM): Define this, not _CTF_STR.
  252. (_ctf_errlist, _ctf_erridx): Use _CTF_ERRORS.
  253. (ERRSTRFIELD): Rewrite.
  254. (ERRSTRFIELD1): Remove.
  255. * Makefile.in: Rebuild.
  256. * Makefile.am (BUILT_SOURCES): Remove.
  257. (ctf-error.h): Remove.
  258. 2020-08-27 Nick Alcock <nick.alcock@oracle.com>
  259. * ctf-subr.c (open_errors): New list.
  260. (ctf_err_warn): Calls with NULL fp append to open_errors. Add err
  261. parameter, and use it to decorate the debug stream with errmsgs.
  262. (ctf_err_warn_to_open): Splice errors from a CTF dict into the
  263. open_errors.
  264. (ctf_errwarning_next): Calls with NULL fp report from open_errors.
  265. New err param to report iteration errors (including end-of-iteration)
  266. when fp is NULL.
  267. (ctf_assert_fail_internal): Adjust ctf_err_warn call for new err
  268. parameter: gettextize.
  269. * ctf-impl.h (ctfo_get_vbytes): Add ctf_file_t parameter.
  270. (LCTF_VBYTES): Adjust.
  271. (ctf_err_warn_to_open): New.
  272. (ctf_err_warn): Adjust.
  273. (ctf_bundle): Used in only one place: move...
  274. * ctf-create.c: ... here.
  275. (enumcmp): Use ctf_err_warn, not ctf_dprintf, passing the err number
  276. down as needed. Don't emit the errmsg. Gettextize.
  277. (membcmp): Likewise.
  278. (ctf_add_type_internal): Likewise.
  279. (ctf_write_mem): Likewise.
  280. (ctf_compress_write): Likewise. Report errors writing the header or
  281. body.
  282. (ctf_write): Likewise.
  283. * ctf-archive.c (ctf_arc_write_fd): Use ctf_err_warn, not
  284. ctf_dprintf, and gettextize, as above.
  285. (ctf_arc_write): Likewise.
  286. (ctf_arc_bufopen): Likewise.
  287. (ctf_arc_open_internal): Likewise.
  288. * ctf-labels.c (ctf_label_iter): Likewise.
  289. * ctf-open-bfd.c (ctf_bfdclose): Likewise.
  290. (ctf_bfdopen): Likewise.
  291. (ctf_bfdopen_ctfsect): Likewise.
  292. (ctf_fdopen): Likewise.
  293. * ctf-string.c (ctf_str_write_strtab): Likewise.
  294. * ctf-types.c (ctf_type_resolve): Likewise.
  295. * ctf-open.c (get_vbytes_common): Likewise. Pass down the ctf dict.
  296. (get_vbytes_v1): Pass down the ctf dict.
  297. (get_vbytes_v2): Likewise.
  298. (flip_ctf): Likewise.
  299. (flip_types): Likewise. Use ctf_err_warn, not ctf_dprintf, and
  300. gettextize, as above.
  301. (upgrade_types_v1): Adjust calls.
  302. (init_types): Use ctf_err_warn, not ctf_dprintf, as above.
  303. (ctf_bufopen_internal): Likewise. Adjust calls. Transplant errors
  304. emitted into individual dicts into the open errors if this turns
  305. out to be a failed open in the end.
  306. * ctf-dump.c (ctf_dump_format_type): Adjust ctf_err_warn for new err
  307. argument. Gettextize. Don't emit the errmsg.
  308. (ctf_dump_funcs): Likewise. Collapse err label into its only case.
  309. (ctf_dump_type): Likewise.
  310. * ctf-link.c (ctf_create_per_cu): Adjust ctf_err_warn for new err
  311. argument. Gettextize. Don't emit the errmsg.
  312. (ctf_link_one_type): Likewise.
  313. (ctf_link_lazy_open): Likewise.
  314. (ctf_link_one_input_archive): Likewise.
  315. (ctf_link_deduplicating_count_inputs): Likewise.
  316. (ctf_link_deduplicating_open_inputs): Likewise.
  317. (ctf_link_deduplicating_close_inputs): Likewise.
  318. (ctf_link_deduplicating): Likewise.
  319. (ctf_link): Likewise.
  320. (ctf_link_deduplicating_per_cu): Likewise. Add some missed
  321. ctf_set_errnos to obscure error cases.
  322. * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_err_warn for new
  323. err argument. Gettextize. Don't emit the errmsg.
  324. (ctf_dedup_populate_mappings): Likewise.
  325. (ctf_dedup_detect_name_ambiguity): Likewise.
  326. (ctf_dedup_init): Likewise.
  327. (ctf_dedup_multiple_input_dicts): Likewise.
  328. (ctf_dedup_conflictify_unshared): Likewise.
  329. (ctf_dedup): Likewise.
  330. (ctf_dedup_rwalk_one_output_mapping): Likewise.
  331. (ctf_dedup_id_to_target): Likewise.
  332. (ctf_dedup_emit_type): Likewise.
  333. (ctf_dedup_emit_struct_members): Likewise.
  334. (ctf_dedup_populate_type_mapping): Likewise.
  335. (ctf_dedup_populate_type_mappings): Likewise.
  336. (ctf_dedup_emit): Likewise.
  337. (ctf_dedup_hash_type): Likewise. Fix a bit of messed-up error
  338. status setting.
  339. (ctf_dedup_rwalk_one_output_mapping): Likewise. Don't hide
  340. unknown-type-kind messages (which signify file corruption).
  341. 2020-08-27 Nick Alcock <nick.alcock@oracle.com>
  342. * configure.ac: Adjust package name to simply 'libctf': arbitrarily
  343. declare this to be version 1.2.0.
  344. * Makefile.am (AM_CPPFLAGS): Add @INCINTL@.
  345. * Makefile.in: Regenerated.
  346. * configure: Regenerated.
  347. * ctf-intl.h: New file, lightly modified from opcodes/opintl.h.
  348. * ctf-impl.h: Include it.
  349. * ctf-error.r (_ctf_errlist_t): Mark strings as noop-translatable.
  350. (ctf_errmsg): Actually translate them.
  351. 2020-07-26 Eli Zaretskii <eliz@gnu.org>
  352. PR binutils/25155:
  353. * ctf-create.c (EOVERFLOW): If not defined by system header,
  354. redirect to ERANGE as a poor man's substitute.
  355. * ctf-subr.c (ENOTSUP): If not defined, use ENOSYS instead.
  356. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  357. * ctf-create.c (ctf_dtd_insert): Add uintptr_t casts.
  358. (ctf_dtd_delete): Likewise.
  359. (ctf_dtd_lookup): Likewise.
  360. (ctf_rollback): Likewise.
  361. * ctf-hash.c (ctf_hash_lookup_type): Likewise.
  362. * ctf-types.c (ctf_lookup_by_rawhash): Likewise.
  363. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  364. * ctf-lookup.c (ctf_lookup_by_name): Adjust.
  365. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  366. * ctf-archive.c (ctf_arc_bufopen): Endian-swap the archive magic
  367. number if needed.
  368. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  369. * ctf-impl.h (ctf_list_splice): New.
  370. * ctf-util.h (ctf_list_splice): Likewise.
  371. * ctf-link.c (link_sort_inputs_cb_arg_t): Likewise.
  372. (ctf_link_sort_inputs): Likewise.
  373. (ctf_link_deduplicating_count_inputs): Likewise.
  374. (ctf_link_deduplicating_open_inputs): Likewise.
  375. (ctf_link_deduplicating_close_inputs): Likewise.
  376. (ctf_link_deduplicating_variables): Likewise.
  377. (ctf_link_deduplicating_per_cu): Likewise.
  378. (ctf_link_deduplicating): Likewise.
  379. (ctf_link): Call it.
  380. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  381. * ctf-link.c (ctf_link_one_input_archive_member): Check
  382. CTF_LINK_OMIT_VARIABLES_SECTION.
  383. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  384. * ctf-impl.h (ctf_type_id_key): New, the key in the
  385. cd_id_to_file_t.
  386. (ctf_dedup): New, core deduplicator state.
  387. (ctf_file_t) <ctf_dedup>: New.
  388. <ctf_dedup_atoms>: New.
  389. <ctf_dedup_atoms_alloc>: New.
  390. (ctf_hash_type_id_key): New prototype.
  391. (ctf_hash_eq_type_id_key): Likewise.
  392. (ctf_dedup_atoms_init): Likewise.
  393. * ctf-hash.c (ctf_hash_eq_type_id_key): New.
  394. (ctf_dedup_atoms_init): Likewise.
  395. * ctf-create.c (ctf_serialize): Adjusted.
  396. (ctf_add_encoded): No longer static.
  397. (ctf_add_reftype): Likewise.
  398. * ctf-open.c (ctf_file_close): Destroy the
  399. ctf_dedup_atoms_alloc.
  400. * ctf-dedup.c: New file.
  401. * ctf-decls.h [!HAVE_DECL_STPCPY]: Add prototype.
  402. * configure.ac: Check for stpcpy.
  403. * Makefile.am: Add it.
  404. * Makefile.in: Regenerate.
  405. * config.h.in: Regenerate.
  406. * configure: Regenerate.
  407. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  408. * configure.ac: Add --enable-libctf-hash-debugging.
  409. * aclocal.m4: Pull in enable.m4, for GCC_ENABLE.
  410. * Makefile.in: Regenerated.
  411. * configure: Likewise.
  412. * config.h.in: Likewise.
  413. * ctf-impl.h [ENABLE_LIBCTF_HASH_DEBUGGING]
  414. (ctf_assert): Define to assert.
  415. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  416. * ctf-sha1.h: New, inline wrappers around sha1_init_ctx and
  417. sha1_process_bytes.
  418. * ctf-impl.h: Include it.
  419. (ctf_sha1_init): New.
  420. (ctf_sha1_add): Likewise.
  421. (ctf_sha1_fini): Likewise.
  422. * ctf-sha1.c: New, non-inline wrapper around sha1_finish_ctx
  423. producing strings.
  424. * Makefile.am: Add file.
  425. * Makefile.in: Regenerate.
  426. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  427. * libctf.ver (ctf_link_set_variable_filter): Add.
  428. * ctf-impl.h (ctf_file_t) <ctf_link_variable_filter>: New.
  429. <ctf_link_variable_filter_arg>: Likewise.
  430. * ctf-create.c (ctf_serialize): Adjust.
  431. * ctf-link.c (ctf_link_set_variable_filter): New, set it.
  432. (ctf_link_one_variable): Call it if set.
  433. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  434. * ctf-link.c (ctf_link_one_variable): Check the dst_type for
  435. conflicts, not the source type.
  436. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  437. * ctf-impl.h (ctf_file_t): Improve comments.
  438. <ctf_link_cu_mapping>: Split into...
  439. <ctf_link_in_cu_mapping>: ... this...
  440. <ctf_link_out_cu_mapping>: ... and this.
  441. * ctf-create.c (ctf_serialize): Adjust.
  442. * ctf-open.c (ctf_file_close): Likewise.
  443. * ctf-link.c (ctf_create_per_cu): Look things up in the
  444. in_cu_mapping instead of the cu_mapping.
  445. (ctf_link_add_cu_mapping): The deduplicating link will define
  446. what happens if many FROMs share a TO.
  447. (ctf_link_add_cu_mapping): Create in_cu_mapping and
  448. out_cu_mapping. Do not create ctf_link_outputs here any more, or
  449. create per-CU dicts here: they are already created when needed.
  450. (ctf_link_one_variable): Log a debug message if we skip a
  451. variable due to its type being concealed in a CU-mapped link.
  452. (This is probably too common a case to make into a warning.)
  453. (ctf_link): Create empty per-CU dicts if requested.
  454. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  455. * ctf-link.c (ctf_link_write): Close the fd.
  456. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  457. * Makefile.am: Set -DNOBFD=1 in libctf-nobfd, and =0 elsewhere.
  458. * Makefile.in: Regenerated.
  459. * ctf-impl.h (ctf_link_input_name): New.
  460. (ctf_file_t) <ctf_link_flags>: New.
  461. * ctf-create.c (ctf_serialize): Adjust accordingly.
  462. * ctf-link.c: Define ctf_open as weak when PIC.
  463. (ctf_arc_close_thunk): Remove unnecessary thunk.
  464. (ctf_file_close_thunk): Likewise.
  465. (ctf_link_input_name): New.
  466. (ctf_link_input_t): New value of the ctf_file_t.ctf_link_input.
  467. (ctf_link_input_close): Adjust accordingly.
  468. (ctf_link_add_ctf_internal): New, split from...
  469. (ctf_link_add_ctf): ... here. Return error if lazy loading of
  470. CTF is not possible. Change to just call...
  471. (ctf_link_add): ... this new function.
  472. (ctf_link_add_cu_mapping): Transition to ctf_err_warn. Drop the
  473. ctf_file_close_thunk.
  474. (ctf_link_in_member_cb_arg_t) <file_name> Rename to...
  475. <in_file_name>: ... this.
  476. <arcname>: Drop.
  477. <share_mode>: Likewise (migrated to ctf_link_flags).
  478. <done_main_member>: Rename to...
  479. <done_parent>: ... this.
  480. <main_input_fp>: Rename to...
  481. <in_fp_parent>: ... this.
  482. <cu_mapped>: New.
  483. (ctf_link_one_type): Adjuwt accordingly. Transition to
  484. ctf_err_warn, removing a TODO.
  485. (ctf_link_one_variable): Note a case too common to warn about.
  486. Report in the debug stream if a cu-mapped link prevents addition
  487. of a conflicting variable.
  488. (ctf_link_one_input_archive_member): Adjust.
  489. (ctf_link_lazy_open): New, open a CTF archive for linking when
  490. needed.
  491. (ctf_link_close_one_input_archive): New, close it again.
  492. (ctf_link_one_input_archive): Adjust for lazy opening, member
  493. renames, and ctf_err_warn transition. Move the
  494. empty_link_type_mapping call to...
  495. (ctf_link): ... here. Adjut for renamings and thunk removal.
  496. Don't spuriously fail if some input contains no CTF data.
  497. (ctf_link_write): ctf_err_warn transition.
  498. * libctf.ver: Remove not-yet-stable comment.
  499. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  500. * ctf-impl.h (ctf_strerror): Delete.
  501. * ctf-subr.c (ctf_strerror): Likewise.
  502. * ctf-error.c (ctf_errmsg): Stop using ctf_strerror: just use
  503. strerror directly.
  504. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  505. * ctf-impl.c (ctf_file_t) <ctf_parent_unreffed>: New.
  506. (ctf_import_unref): New.
  507. * ctf-open.c (ctf_file_close) Drop the refcount all the way to
  508. zero. Don't recurse back in if the refcount is already zero.
  509. (ctf_import): Check ctf_parent_unreffed before deciding whether
  510. to close a pre-existing parent. Set it to zero.
  511. (ctf_import_unreffed): New, as above, setting
  512. ctf_parent_unreffed to 1.
  513. * ctf-create.c (ctf_serialize): Do not ctf_import into the new
  514. child: use direct assignment, and set unreffed on the new and
  515. old children.
  516. * ctf-link.c (ctf_create_per_cu): Import the parent using
  517. ctf_import_unreffed.
  518. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  519. * ctf-impl.h (ctf_link_type_mapping_key): Rename to...
  520. (ctf_link_type_key): ... this, adjusting member prefixes to
  521. match.
  522. (ctf_hash_type_mapping_key): Rename to...
  523. (ctf_hash_type_key): ... this.
  524. (ctf_hash_eq_type_mapping_key): Rename to...
  525. (ctf_hash_eq_type_key): ... this.
  526. * ctf-hash.c (ctf_hash_type_mapping_key): Rename to...
  527. (ctf_hash_type_key): ... this, and adjust for member name
  528. changes.
  529. (ctf_hash_eq_type_mapping_key): Rename to...
  530. (ctf_hash_eq_type_key): ... this, and adjust for member name
  531. changes.
  532. * ctf-link.c (ctf_add_type_mapping): Adjust. Note the lack of
  533. need for out-of-memory checking in this code.
  534. (ctf_type_mapping): Adjust.
  535. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  536. configure.ac: Check for vasprintf.
  537. configure: Regenerated.
  538. config.h.in: Likewise.
  539. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  540. * ctf-archive.c (ctf_arc_bufopen): Fix message.
  541. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  542. * ctf-impl.h (struct ctf_archive_internal) <ctfi_free_strsect>
  543. New.
  544. * ctf-open-bfd.c (ctf_bfdopen_ctfsect): Explicitly open a strtab
  545. if the input has no symtab, rather than dividing by
  546. zero. Arrange to free it later via ctfi_free_ctfsect.
  547. * ctf-archive.c (ctf_new_archive_internal): Do not
  548. ctfi_free_strsect by default.
  549. (ctf_arc_close): Possibly free it here.
  550. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  551. * ctf-dump.c (ctf_is_slice): Delete, unnecessary.
  552. (ctf_dump_format_type): improve slice formatting. Always print
  553. the type size, even of slices.
  554. (ctf_dump_member): Print slices (-> bitfields) differently from
  555. non-slices. Failure to format a type is not an OOM.
  556. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  557. * ctf-dump.c (ctf_dump_format_type): Emit a warning.
  558. (ctf_dump_label): Swallow errors from ctf_dump_format_type.
  559. (ctf_dump_objts): Likewise.
  560. (ctf_dump_var): Likewise.
  561. (ctf_dump_type): Do not emit a duplicate message. Move to
  562. ctf_err_warning, and swallow all errors.
  563. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  564. * ctf-decl.c (ctf_decl_fini): Free the cd_buf.
  565. (ctf_decl_buf): Once it escapes, don't try to free it later.
  566. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  567. * ctf-types.c (ctf_type_aname): Print arg types here...
  568. * ctf-dump.c (ctf_dump_funcs): ... not here: but do substitute
  569. in the type name here.
  570. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  571. * ctf-impl.h (ctf_assert): New.
  572. (ctf_err_warning_t): Likewise.
  573. (ctf_file_t) <ctf_errs_warnings>: Likewise.
  574. (ctf_err_warn): New prototype.
  575. (ctf_assert_fail_internal): Likewise.
  576. * ctf-inlines.h (ctf_assert_internal): Likewise.
  577. * ctf-open.c (ctf_file_close): Free ctf_errs_warnings.
  578. * ctf-create.c (ctf_serialize): Copy it on serialization.
  579. * ctf-subr.c (ctf_err_warn): New, add an error/warning.
  580. (ctf_errwarning_next): New iterator, free and pass back
  581. errors/warnings in succession.
  582. * libctf.ver (ctf_errwarning_next): Add.
  583. 2020-07-22 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
  584. * ctf-types.c (ctf_variable_iter): Fix error return.
  585. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  586. * ctf-open.c (ctf_bufopen_internal): Diagnose invalid flags.
  587. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  588. ctf-decls.h (ctf_qsort_compar_thunk): Fix arg passing.
  589. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  590. * ctf-impl.h (ctf_next_hkv_t): New, kv-pairs passed to
  591. sorting functions.
  592. (ctf_next_t) <u.ctn_sorted_hkv>: New, sorted kv-pairs for
  593. ctf_dynhash_next_sorted.
  594. <cu.ctn_h>: New, pointer to the dynhash under iteration.
  595. <cu.ctn_s>: New, pointer to the dynset under iteration.
  596. (ctf_hash_sort_f): Sorting function passed to...
  597. (ctf_dynhash_next_sorted): ... this new function.
  598. (ctf_dynhash_next): New.
  599. (ctf_dynset_next): New.
  600. * ctf-inlines.h (ctf_dynhash_cnext_sorted): New.
  601. (ctf_dynhash_cnext): New.
  602. (ctf_dynset_cnext): New.
  603. * ctf-hash.c (ctf_dynhash_next_sorted): New.
  604. (ctf_dynhash_next): New.
  605. (ctf_dynset_next): New.
  606. * ctf-util.c (ctf_next_destroy): Free the u.ctn_sorted_hkv if
  607. needed.
  608. (ctf_next_copy): Alloc-and-copy the u.ctn_sorted_hkv if needed.
  609. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  610. * ctf-impl.h (ctf_next): New.
  611. (ctf_get_dict): New prototype.
  612. * ctf-lookup.c (ctf_get_dict): New, split out of...
  613. (ctf_lookup_by_id): ... here.
  614. * ctf-util.c (ctf_next_create): New.
  615. (ctf_next_destroy): New.
  616. (ctf_next_copy): New.
  617. * ctf-types.c (includes): Add <assert.h>.
  618. (ctf_member_next): New.
  619. (ctf_enum_next): New.
  620. (ctf_type_iter): Document the lack of iteration over parent
  621. types.
  622. (ctf_type_next): New.
  623. (ctf_variable_next): New.
  624. * ctf-archive.c (ctf_archive_next): New.
  625. * libctf.ver: Add new public functions.
  626. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  627. * libctf.ver (ctf_ref): New.
  628. * ctf-open.c (ctf_ref): Implement it.
  629. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  630. * ctf-inlines.h (ctf_forwardable_kind): New.
  631. * ctf-create.c (ctf_add_forward): Use it.
  632. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  633. * ctf-impl.h (ctf_get_ctt_size): Move definition from here...
  634. * ctf-inlines.h (ctf_get_ctt_size): ... to here.
  635. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  636. * ctf-hash.c (ctf_dynset_eq_string): New.
  637. (ctf_dynset_create): New.
  638. (DYNSET_EMPTY_ENTRY_REPLACEMENT): New.
  639. (DYNSET_DELETED_ENTRY_REPLACEMENT): New.
  640. (key_to_internal): New.
  641. (internal_to_key): New.
  642. (ctf_dynset_insert): New.
  643. (ctf_dynset_remove): New.
  644. (ctf_dynset_destroy): New.
  645. (ctf_dynset_lookup): New.
  646. (ctf_dynset_exists): New.
  647. (ctf_dynset_lookup_any): New.
  648. (ctf_hash_insert_type): Coding style.
  649. (ctf_hash_define_type): Likewise.
  650. * ctf-impl.h (ctf_dynset_t): New.
  651. (ctf_dynset_eq_string): New.
  652. (ctf_dynset_create): New.
  653. (ctf_dynset_insert): New.
  654. (ctf_dynset_remove): New.
  655. (ctf_dynset_destroy): New.
  656. (ctf_dynset_lookup): New.
  657. (ctf_dynset_exists): New.
  658. (ctf_dynset_lookup_any): New.
  659. * ctf-inlines.h (ctf_dynset_cinsert): New.
  660. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  661. * ctf-hash.c (ctf_helem_t) <key_free>: Remove.
  662. <value_free>: Likewise.
  663. <owner>: New.
  664. (ctf_dynhash_item_free): Indirect through the owner.
  665. (ctf_dynhash_create): Only pass in ctf_dynhash_item_free and
  666. allocate space for the key_free and value_free fields fields
  667. if necessary.
  668. (ctf_hashtab_insert): Likewise. Fix OOM errno value.
  669. (ctf_dynhash_insert): Only access ctf_hashtab's key_free and
  670. value_free if they will exist. Set the slot's owner, but only
  671. if it exists.
  672. (ctf_dynhash_remove): Adjust.
  673. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  674. * ctf-hash.c (ctf_hashtab_insert): Free the key passed in if
  675. there is a key-freeing function and the key already exists.
  676. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  677. * ctf-inlines.h: New file.
  678. * ctf-impl.h: Include it.
  679. (ctf_hash_iter_find_f): New typedef.
  680. (ctf_dynhash_elements): New.
  681. (ctf_dynhash_lookup_kv): New.
  682. (ctf_dynhash_iter_find): New.
  683. * ctf-hash.c (ctf_dynhash_lookup_kv): New.
  684. (ctf_traverse_find_cb_arg_t): New.
  685. (ctf_hashtab_traverse_find): New.
  686. (ctf_dynhash_iter_find): New.
  687. (ctf_dynhash_elements): New.
  688. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  689. * ctf-impl.h [!__GNUC__] (__extension__): Define to nothing.
  690. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  691. * ctf-archive.c (ctf_archive_count): New.
  692. * libctf.ver: New public function.
  693. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  694. * ctf-types.c (ctf_member_count): New.
  695. * libctf.ver: New public function.
  696. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  697. * ctf-types.c (ctf_type_kind_forwarded): New.
  698. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  699. * ctf-types.c (ctf_type_name_raw): New.
  700. (ctf_type_aname_raw): Reimplement accordingly.
  701. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  702. * ctf-subr.c (ctf_dprintf): _libctf_debug is unlikely to be set.
  703. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  704. * ctf-impl.h (struct ctf_archive_internal)
  705. <ctfi_unmap_on_close>: New.
  706. (ctf_new_archive_internal): Adjust.
  707. * ctf-archive.c (ctf_new_archive_internal): Likewise.
  708. Initialize ctfi_unmap_on_close. Adjust error path.
  709. (ctf_arc_bufopen): Adjust ctf_new_archive_internal call
  710. (unmap_on_close is 0).
  711. (ctf_arc_close): Only unmap if ctfi_unmap_on_close.
  712. * ctf-open-bfd.c (ctf_fdopen): Adjust.
  713. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  714. * ctf-types.c (ctf_type_aname): Return ECTF_CORRUPT if
  715. ints, floats or typedefs have no name. Fix comment typo.
  716. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  717. * ctf-create.c (ctf_add_slice): Support slices of any kind that
  718. resolves to an integral type.
  719. * ctf-types.c (ctf_type_encoding): Resolve the type before
  720. fishing its encoding out.
  721. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  722. * ctf-create.c (ctf_create): Mark dirty.
  723. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  724. * ctf-create.c (membcmp) Skip nameless members.
  725. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  726. * ctf-create.c (ctf_add_member_offset): Support names of ""
  727. as if they were the null pointer.
  728. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  729. * ctf-open.c (init_types): Remove typeless CTF_K_FORWARD
  730. special-casing.
  731. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  732. * ctf-types.c (ctf_type_reference): Add support for dynamic slices.
  733. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  734. * ctf-create.c (ctf_serialize): Add cast.
  735. (ctf_add_slice): Likewise.
  736. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  737. * ctf-impl.h (ctf_dtdef_t) <dtu_argv>: Fix type.
  738. * ctf-create.c (ctf_add_function): Check for unimplemented type
  739. and populate at the same time. Populate one-by-one, not via
  740. memcpy.
  741. (ctf_serialize): Remove unnecessary cast.
  742. * ctf-types.c (ctf_func_type_info): Likewise.
  743. (ctf_func_type_args): Likewise. Fix comment typo.
  744. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  745. * ctf-create.c (ctf_add_reftype): Support refs to type zero.
  746. (ctf_add_array): Support array contents of type zero.
  747. (ctf_add_function): Support arguments and return types of
  748. type zero.
  749. (ctf_add_typedef): Support typedefs to type zero.
  750. (ctf_add_member_offset): Support members of type zero,
  751. unless added at unspecified (naturally-aligned) offset.
  752. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  753. * ctf-error.c: Include <stddef.h>, for offsetof.
  754. (_ctf_errlist): Migrate to...
  755. (_ctf_errlist_t): ... this.
  756. (_ctf_erridx): New, indexes into _ctf_errlist_t.
  757. (_ctf_nerr): Remove.
  758. (ctf_errmsg): Adjust accordingly.
  759. * Makefile.am (BUILT_SOURCES): Note...
  760. (ctf-error.h): ... this new rule.
  761. * Makefile.in: Regenerate.
  762. * mkerrors.sed: New, process ctf-api.h to generate ctf-error.h.
  763. * .gitignore: New, ignore ctf-error.h.
  764. 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
  765. * ctf-impl.h: Fix typos in comments.
  766. 2020-07-22 Nick Clifton <nickc@redhat.com>
  767. * ctf-archive.c (ctf_arc_write): Avoid calling close twice on the
  768. same file descriptor.
  769. 2020-07-04 Nick Clifton <nickc@redhat.com>
  770. Binutils 2.35 branch created.
  771. 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
  772. * aclocal.m4: Add config/gettext-sister.m4: Shuffle into
  773. alphabetical order.
  774. * configure.ac: Add ZW_GNU_GETTEXT_SISTER_DIR.
  775. * config.h.in: Regenerated.
  776. * Makefile.in: Likewise.
  777. * configure: Likewise.
  778. 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
  779. * ctf-create.c: Include <unistd.h>.
  780. * ctf-open-bfd.c: Likewise.
  781. 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
  782. PR libctf/25120
  783. * configure.ac: Check for bswap_16, bswap_32, and bswap_64 decls.
  784. * swap.h (bswap_16): Do not assume that presence of <byteswap.h>
  785. means this is declared.
  786. (bswap_32): Likewise.
  787. (bswap_64): Likewise.
  788. (bswap_identity_64): Remove, unused.
  789. * configure: Regenerated.
  790. * config.h.in: Likewise.
  791. 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
  792. PR libctf/25120
  793. * ctf-impl.h (_libctf_printflike_): Add non-GNU-C fallback.
  794. (_libctf_unlikely_): Likewise.
  795. (_libctf_unused): Likewise.
  796. (_libctf_malloc_): Likewise.
  797. 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
  798. PR libctf/25120
  799. * ctf-archive.c (search_nametbl): No longer global: declare...
  800. (ctf_arc_open_by_name_internal): ... here. Use bsearch_r.
  801. (search_modent_by_name): Take and use ARG for the nametbl.
  802. 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
  803. * ctf-impl.h (ctf_new_archive_internal): Declare.
  804. (ctf_arc_bufopen): Remove.
  805. (ctf_archive_internal) <ctfi_free_symsect>: New.
  806. * ctf-archive.c (ctf_arc_close): Use it.
  807. (ctf_arc_bufopen): Fuse into...
  808. (ctf_new_archive_internal): ... this, moved across from...
  809. * ctf-open-bfd.c: ... here.
  810. (ctf_bfdopen_ctfsect): Use ctf_arc_bufopen.
  811. * libctf.ver: Add it.
  812. 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
  813. * ctf-create.c (ctf_add_forward): Intern in the right namespace.
  814. (ctf_dtd_delete): Remove correspondingly.
  815. (ctf_rollback): Likewise.
  816. 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
  817. * ctf-create.c (ctf_add_type_internal): Hand back existing types
  818. unchanged.
  819. 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
  820. * ctf-create.c (ctf_add_forward): Don't add forwards to
  821. types that already exist.
  822. 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
  823. * ctf-open.c (init_types): Only intern root-visible types.
  824. * ctf-create.c (ctf_dtd_insert): Likewise.
  825. (ctf_dtd_delete): Only remove root-visible types.
  826. (ctf_rollback): Likewise.
  827. (ctf_add_generic): Adjust.
  828. (ctf_add_struct_sized): Adjust comment.
  829. (ctf_add_union_sized): Likewise.
  830. (ctf_add_enum): Likewise.
  831. * ctf-impl.h (ctf_dtd_insert): Adjust prototype.
  832. 2020-03-11 John Baldwin <jhb@FreeBSD.org>
  833. * swap.h (bswap_identity_64): Make static.
  834. 2020-01-18 Nick Clifton <nickc@redhat.com>
  835. Binutils 2.34 branch created.
  836. 2020-01-05 Joel Brobecker <brobecker@adacore.com>
  837. PR binutils/25155:
  838. * configure.ac: Add AC_CHECK_DECLS([asprintf]).
  839. * configure, config.h.in: Regenerate.
  840. 2020-01-01 Alan Modra <amodra@gmail.com>
  841. Update year range in copyright notice of all files.
  842. 2019-10-16 Simon Marchi <simon.marchi@polymtl.ca>
  843. * swap.h (bswap_16, bswap_32, bswap_64): Make static.
  844. 2019-09-30 Nick Alcock <nick.alcock@oracle.com>
  845. * ctf-open.c (ctf_bufopen_internal): Fix tabdamage.
  846. * ctf-types.c (ctf_type_lname): Likewise.
  847. 2019-09-23 Nick Alcock <nick.alcock@oracle.com>
  848. * ctf-open.c (ctf_import): Do not leak a ctf_file_t ref on every
  849. ctf_import after the first for a given file.
  850. 2019-09-23 Nick Alcock <nick.alcock@oracle.com>
  851. * ctf-impl.h (ctf_str_append_noerr): Declare.
  852. * ctf-util.c (ctf_str_append_noerr): Define in terms of
  853. ctf_str_append.
  854. * ctf-dump.c (str_append): New, call it.
  855. (ctf_dump_format_type): Use str_append, not ctf_str_append.
  856. (ctf_dump_label): Likewise.
  857. (ctf_dump_objts): Likewise.
  858. (ctf_dump_funcs): Likewise.
  859. (ctf_dump_var): Likewise.
  860. (ctf_dump_member): Likewise.
  861. (ctf_dump_type): Likewise.
  862. (ctf_dump): Likewise.
  863. 2019-09-23 Nick Alcock <nick.alcock@oracle.com>
  864. * ctf-impl.h (ctf_alloc): Remove.
  865. (ctf_free): Likewise.
  866. (ctf_strdup): Likewise.
  867. * ctf-subr.c (ctf_alloc): Remove.
  868. (ctf_free): Likewise.
  869. * ctf-util.c (ctf_strdup): Remove.
  870. * ctf-create.c (ctf_serialize): Use malloc, not ctf_alloc; free, not
  871. ctf_free; strdup, not ctf_strdup.
  872. (ctf_dtd_delete): Likewise.
  873. (ctf_dvd_delete): Likewise.
  874. (ctf_add_generic): Likewise.
  875. (ctf_add_function): Likewise.
  876. (ctf_add_enumerator): Likewise.
  877. (ctf_add_member_offset): Likewise.
  878. (ctf_add_variable): Likewise.
  879. (membadd): Likewise.
  880. (ctf_compress_write): Likewise.
  881. (ctf_write_mem): Likewise.
  882. * ctf-decl.c (ctf_decl_push): Likewise.
  883. (ctf_decl_fini): Likewise.
  884. (ctf_decl_sprintf): Likewise. Check for OOM.
  885. * ctf-dump.c (ctf_dump_append): Use malloc, not ctf_alloc; free, not
  886. ctf_free; strdup, not ctf_strdup.
  887. (ctf_dump_free): Likewise.
  888. (ctf_dump): Likewise.
  889. * ctf-open.c (upgrade_types_v1): Likewise.
  890. (init_types): Likewise.
  891. (ctf_file_close): Likewise.
  892. (ctf_bufopen_internal): Likewise. Check for OOM.
  893. (ctf_parent_name_set): Likewise: report the OOM to the caller.
  894. (ctf_cuname_set): Likewise.
  895. (ctf_import): Likewise.
  896. * ctf-string.c (ctf_str_purge_atom_refs): Use malloc, not ctf_alloc;
  897. free, not ctf_free; strdup, not ctf_strdup.
  898. (ctf_str_free_atom): Likewise.
  899. (ctf_str_create_atoms): Likewise.
  900. (ctf_str_add_ref_internal): Likewise.
  901. (ctf_str_remove_ref): Likewise.
  902. (ctf_str_write_strtab): Likewise.
  903. 2019-08-09 Nick Alcock <nick.alcock@oracle.com>
  904. * ctf-types.c (ctf_type_encoding): Fix the dynamic case to
  905. work right for non-int/fps.
  906. 2019-08-08 Nick Alcock <nick.alcock@oracle.com>
  907. * ctf-types.c (ctf_type_name): Don't strlen a potentially-
  908. null pointer.
  909. 2019-08-07 Nick Alcock <nick.alcock@oracle.com>
  910. * ctf-impl.h (ctf_file_t) <ctf_add_processing>: New.
  911. * ctf-open.c (ctf_file_close): Free it.
  912. * ctf-create.c (ctf_serialize): Adjust.
  913. (membcmp): When reporting a conflict due to an error, report the
  914. error.
  915. (ctf_add_type): Turn into a ctf_add_processing wrapper. Rename to...
  916. (ctf_add_type_internal): ... this. Hand back types we are already
  917. in the middle of adding immediately. Hand back structs/unions with
  918. the same number of members immediately. Do not walk the dynamic
  919. list. Call ctf_add_type_internal, not ctf_add_type. Handle
  920. forwards promoted to other types and the inverse case identically.
  921. Add structs to the mapping as soon as we intern them, before they
  922. gain any members.
  923. 2019-08-09 Nick Alcock <nick.alcock@oracle.com>
  924. * ctf-impl.h (ctf_names_t): New.
  925. (ctf_lookup_t) <ctf_hash>: Now a ctf_names_t, not a ctf_hash_t.
  926. (ctf_file_t) <ctf_structs>: Likewise.
  927. <ctf_unions>: Likewise.
  928. <ctf_enums>: Likewise.
  929. <ctf_names>: Likewise.
  930. <ctf_lookups>: Improve comment.
  931. <ctf_ptrtab_len>: New.
  932. <ctf_prov_strtab>: New.
  933. <ctf_str_prov_offset>: New.
  934. <ctf_dtbyname>: Remove, redundant to the names hashes.
  935. <ctf_dtnextid>: Remove, redundant to ctf_typemax.
  936. (ctf_dtdef_t) <dtd_name>: Remove.
  937. <dtd_data>: Note that the ctt_name is now populated.
  938. (ctf_str_atom_t) <csa_offset>: This is now the strtab
  939. offset for internal strings too.
  940. <csa_external_offset>: New, the external strtab offset.
  941. (CTF_INDEX_TO_TYPEPTR): Handle the LCTF_RDWR case.
  942. (ctf_name_table): New declaration.
  943. (ctf_lookup_by_rawname): Likewise.
  944. (ctf_lookup_by_rawhash): Likewise.
  945. (ctf_set_ctl_hashes): Likewise.
  946. (ctf_serialize): Likewise.
  947. (ctf_dtd_insert): Adjust.
  948. (ctf_simple_open_internal): Likewise.
  949. (ctf_bufopen_internal): Likewise.
  950. (ctf_list_empty_p): Likewise.
  951. (ctf_str_remove_ref): Likewise.
  952. (ctf_str_add): Returns uint32_t now.
  953. (ctf_str_add_ref): Likewise.
  954. (ctf_str_add_external): Now returns a boolean (int).
  955. * ctf-string.c (ctf_strraw_explicit): Check the ctf_prov_strtab
  956. for strings in the appropriate range.
  957. (ctf_str_create_atoms): Create the ctf_prov_strtab. Detect OOM
  958. when adding the null string to the new strtab.
  959. (ctf_str_free_atoms): Destroy the ctf_prov_strtab.
  960. (ctf_str_add_ref_internal): Add make_provisional argument. If
  961. make_provisional, populate the offset and fill in the
  962. ctf_prov_strtab accordingly.
  963. (ctf_str_add): Return the offset, not the string.
  964. (ctf_str_add_ref): Likewise.
  965. (ctf_str_add_external): Return a success integer.
  966. (ctf_str_remove_ref): New, remove a single ref.
  967. (ctf_str_count_strtab): Do not count the initial null string's
  968. length or the existence or length of any unreferenced internal
  969. atoms.
  970. (ctf_str_populate_sorttab): Skip atoms with no refs.
  971. (ctf_str_write_strtab): Populate the nullstr earlier. Add one
  972. to the cts_len for the null string, since it is no longer done
  973. in ctf_str_count_strtab. Adjust for csa_external_offset rename.
  974. Populate the csa_offset for both internal and external cases.
  975. Flush the ctf_prov_strtab afterwards, and reset the
  976. ctf_str_prov_offset.
  977. * ctf-create.c (ctf_grow_ptrtab): New.
  978. (ctf_create): Call it. Initialize new fields rather than old
  979. ones. Tell ctf_bufopen_internal that this is a writable dictionary.
  980. Set the ctl hashes and data model.
  981. (ctf_update): Rename to...
  982. (ctf_serialize): ... this. Leave a compatibility function behind.
  983. Tell ctf_simple_open_internal that this is a writable dictionary.
  984. Pass the new fields along from the old dictionary. Drop
  985. ctf_dtnextid and ctf_dtbyname. Use ctf_strraw, not dtd_name.
  986. Do not zero out the DTD's ctt_name.
  987. (ctf_prefixed_name): Rename to...
  988. (ctf_name_table): ... this. No longer return a prefixed name: return
  989. the applicable name table instead.
  990. (ctf_dtd_insert): Use it, and use the right name table. Pass in the
  991. kind we're adding. Migrate away from dtd_name.
  992. (ctf_dtd_delete): Adjust similarly. Remove the ref to the
  993. deleted ctt_name.
  994. (ctf_dtd_lookup_type_by_name): Remove.
  995. (ctf_dynamic_type): Always return NULL on read-only dictionaries.
  996. No longer check ctf_dtnextid: check ctf_typemax instead.
  997. (ctf_snapshot): No longer use ctf_dtnextid: use ctf_typemax instead.
  998. (ctf_rollback): Likewise. No longer fail with ECTF_OVERROLLBACK. Use
  999. ctf_name_table and the right name table, and migrate away from
  1000. dtd_name as in ctf_dtd_delete.
  1001. (ctf_add_generic): Pass in the kind explicitly and pass it to
  1002. ctf_dtd_insert. Use ctf_typemax, not ctf_dtnextid. Migrate away
  1003. from dtd_name to using ctf_str_add_ref to populate the ctt_name.
  1004. Grow the ptrtab if needed.
  1005. (ctf_add_encoded): Pass in the kind.
  1006. (ctf_add_slice): Likewise.
  1007. (ctf_add_array): Likewise.
  1008. (ctf_add_function): Likewise.
  1009. (ctf_add_typedef): Likewise.
  1010. (ctf_add_reftype): Likewise. Initialize the ctf_ptrtab, checking
  1011. ctt_name rather than dtd_name.
  1012. (ctf_add_struct_sized): Pass in the kind. Use
  1013. ctf_lookup_by_rawname, not ctf_hash_lookup_type /
  1014. ctf_dtd_lookup_type_by_name.
  1015. (ctf_add_union_sized): Likewise.
  1016. (ctf_add_enum): Likewise.
  1017. (ctf_add_enum_encoded): Likewise.
  1018. (ctf_add_forward): Likewise.
  1019. (ctf_add_type): Likewise.
  1020. (ctf_compress_write): Call ctf_serialize: adjust for ctf_size not
  1021. being initialized until after the call.
  1022. (ctf_write_mem): Likewise.
  1023. (ctf_write): Likewise.
  1024. * ctf-archive.c (arc_write_one_ctf): Likewise.
  1025. * ctf-lookup.c (ctf_lookup_by_name): Use ctf_lookuup_by_rawhash, not
  1026. ctf_hash_lookup_type.
  1027. (ctf_lookup_by_id): No longer check the readonly types if the
  1028. dictionary is writable.
  1029. * ctf-open.c (init_types): Assert that this dictionary is not
  1030. writable. Adjust to use the new name hashes, ctf_name_table,
  1031. and ctf_ptrtab_len. GNU style fix for the final ptrtab scan.
  1032. (ctf_bufopen_internal): New 'writable' parameter. Flip on LCTF_RDWR
  1033. if set. Drop out early when dictionary is writable. Split the
  1034. ctf_lookups initialization into...
  1035. (ctf_set_cth_hashes): ... this new function.
  1036. (ctf_simple_open_internal): Adjust. New 'writable' parameter.
  1037. (ctf_simple_open): Adjust accordingly.
  1038. (ctf_bufopen): Likewise.
  1039. (ctf_file_close): Destroy the appropriate name hashes. No longer
  1040. destroy ctf_dtbyname, which is gone.
  1041. (ctf_getdatasect): Remove spurious "extern".
  1042. * ctf-types.c (ctf_lookup_by_rawname): New, look up types in the
  1043. specified name table, given a kind.
  1044. (ctf_lookup_by_rawhash): Likewise, given a ctf_names_t *.
  1045. (ctf_member_iter): Add support for iterating over the
  1046. dynamic type list.
  1047. (ctf_enum_iter): Likewise.
  1048. (ctf_variable_iter): Likewise.
  1049. (ctf_type_rvisit): Likewise.
  1050. (ctf_member_info): Add support for types in the dynamic type list.
  1051. (ctf_enum_name): Likewise.
  1052. (ctf_enum_value): Likewise.
  1053. (ctf_func_type_info): Likewise.
  1054. (ctf_func_type_args): Likewise.
  1055. * ctf-link.c (ctf_accumulate_archive_names): No longer call
  1056. ctf_update.
  1057. (ctf_link_write): Likewise.
  1058. (ctf_link_intern_extern_string): Adjust for new
  1059. ctf_str_add_external return value.
  1060. (ctf_link_add_strtab): Likewise.
  1061. * ctf-util.c (ctf_list_empty_p): New.
  1062. 2019-08-05 Nick Alcock <nick.alcock@oracle.com>
  1063. * ctf-types.c (ctf_type_resolve): Return ECTF_NONREPRESENTABLE on
  1064. type zero.
  1065. * ctf-create.c (ctf_add_type): Detect and skip nonrepresentable
  1066. members and types.
  1067. (ctf_add_variable): Likewise for variables pointing to them.
  1068. * ctf-link.c (ctf_link_one_type): Do not warn for nonrepresentable
  1069. type link failure, but do warn for others.
  1070. * ctf-dump.c (ctf_dump_format_type): Likewise. Do not assume all
  1071. errors to be ENOMEM.
  1072. (ctf_dump_member): Likewise.
  1073. (ctf_dump_type): Likewise.
  1074. (ctf_dump_header_strfield): Do not assume all errors to be ENOMEM.
  1075. (ctf_dump_header_sectfield): Do not assume all errors to be ENOMEM.
  1076. (ctf_dump_header): Likewise.
  1077. (ctf_dump_label): likewise.
  1078. (ctf_dump_objts): likewise.
  1079. (ctf_dump_funcs): likewise.
  1080. (ctf_dump_var): likewise.
  1081. (ctf_dump_str): Likewise.
  1082. 2019-09-30 Nick Alcock <nick.alcock@oracle.com>
  1083. * configure.ac (AC_DISABLE_SHARED): New, like opcodes/.
  1084. (LT_INIT): Likewise.
  1085. (AM_INSTALL_LIBBFD): Likewise.
  1086. (dlopen): Note why this is necessary in a comment.
  1087. (SHARED_LIBADD): Initialize for possibly-PIC libiberty: derived from
  1088. opcodes/.
  1089. (SHARED_LDFLAGS): Likewise.
  1090. (BFD_LIBADD): Likewise, for libbfd.
  1091. (BFD_DEPENDENCIES): Likewise.
  1092. (VERSION_FLAGS): Initialize, using a version script if ld supports
  1093. one, or libtool -export-symbols-regex otherwise.
  1094. (AC_CONFIG_MACRO_DIR): Add ../BFD.
  1095. * Makefile.am (ACLOCAL_AMFLAGS): Likewise.
  1096. (INCDIR): New.
  1097. (AM_CPPFLAGS): Use $(srcdir), not $(top_srcdir).
  1098. (noinst_LIBRARIES): Replace with...
  1099. [INSTALL_LIBBFD] (lib_LTLIBRARIES): This, or...
  1100. [!INSTALL_LIBBFD] (noinst_LTLIBRARIES): ... this, mentioning new
  1101. libctf-nobfd.la as well.
  1102. [INSTALL_LIBCTF] (include_HEADERS): Add the CTF headers.
  1103. [!INSTALL_LIBCTF] (include_HEADERS): New, empty.
  1104. (libctf_a_SOURCES): Rename to...
  1105. (libctf_nobfd_la_SOURCES): ... this, all of libctf other than
  1106. ctf-open-bfd.c.
  1107. (libctf_la_SOURCES): Now derived from libctf_nobfd_la_SOURCES,
  1108. with ctf-open-bfd.c added.
  1109. (libctf_nobfd_la_LIBADD): New, using @SHARED_LIBADD@.
  1110. (libctf_la_LIBADD): New, using @BFD_LIBADD@ as well.
  1111. (libctf_la_DEPENDENCIES): New, using @BFD_DEPENDENCIES@.
  1112. * Makefile.am [INSTALL_LIBCTF]: Use it.
  1113. * aclocal.m4: Add ../bfd/acinclude.m4, ../config/acx.m4, and the
  1114. libtool macros.
  1115. * libctf.ver: New, everything is version LIBCTF_1.0 currently (even
  1116. the unstable components).
  1117. * Makefile.in: Regenerated.
  1118. * config.h.in: Likewise.
  1119. * configure: Likewise.
  1120. 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
  1121. * configure.ac (INSTALL_LIBCTF): New, controlled by
  1122. --enable-install-libctf.
  1123. [INSTALL_LIBCTF] (lib_LIBRARIES): Add libctf.a.
  1124. * Makefile.in: Regenerated.
  1125. * configure: Regenerated.
  1126. 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
  1127. * ctf-archive.c (ctf_arc_close): Call ctfi_bfd_close if set.
  1128. * ctf-open-bfd.c (ctf_bfdclose): Fix comment.
  1129. 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
  1130. * ctf-open-bfd.c (ctf_fdopen): Call bfd_set_cacheable.
  1131. 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
  1132. * ctf-impl.h (includes): Include <sys/param.h> here.
  1133. 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
  1134. * ctf-open.c (flip_lbls): Eschew for-loop initial declarations.
  1135. (flip_objts): Likewise.
  1136. (flip_vars): Likewise.
  1137. (flip_types): Likewise.
  1138. 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
  1139. * ctf-hash.c (ctf_hashtab_insert): Pass in the key and value
  1140. freeing functions: if set, free the key and value if the slot
  1141. already exists. Always reassign the key.
  1142. (ctf_dynhash_insert): Adjust call appropriately.
  1143. (ctf_hash_insert_type): Likewise.
  1144. 2019-08-03 Nick Alcock <nick.alcock@oracle.com>
  1145. * ctf-create.c (ctf_add_type): Look up and use the forwarded-to
  1146. type kind. Allow forwards to unify with pre-existing structs/
  1147. unions/enums.
  1148. 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
  1149. * ctf-impl.h (ctf_file_t) <ctf_link_cu_mappping>: New.
  1150. <ctf_link_memb_name_changer>: Likewise.
  1151. <ctf_link_memb_name_changer_arg>: Likewise.
  1152. * ctf-create.c (ctf_update): Update accordingly.
  1153. * ctf-open.c (ctf_file_close): Likewise.
  1154. * ctf-link.c (ctf_create_per_cu): Apply the cu mapping.
  1155. (ctf_link_add_cu_mapping): New.
  1156. (ctf_link_set_memb_name_changer): Likewise.
  1157. (ctf_change_parent_name): New.
  1158. (ctf_name_list_accum_cb_arg_t) <dynames>: New, storage for names
  1159. allocated by the caller's ctf_link_memb_name_changer.
  1160. <ndynames>: Likewise.
  1161. (ctf_accumulate_archive_names): Call the ctf_link_memb_name_changer.
  1162. (ctf_link_write): Likewise (for _CTF_SECTION only): also call
  1163. ctf_change_parent_name. Free any resulting names.
  1164. 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
  1165. * ctf-link.c (ctf_create_per_cu): New, refactored out of...
  1166. (ctf_link_one_type): ... here, with parent-name setting added.
  1167. (check_variable): New.
  1168. (ctf_link_one_variable): Likewise.
  1169. (ctf_link_one_input_archive_member): Call it.
  1170. * ctf-error.c (_ctf_errlist): Updated with new errors.
  1171. 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
  1172. * ctf-impl.h (ctf_file_t): New field ctf_link_type_mapping.
  1173. (struct ctf_link_type_mapping_key): New.
  1174. (ctf_hash_type_mapping_key): Likewise.
  1175. (ctf_hash_eq_type_mapping_key): Likewise.
  1176. (ctf_add_type_mapping): Likewise.
  1177. (ctf_type_mapping): Likewise.
  1178. (ctf_dynhash_empty): Likewise.
  1179. * ctf-open.c (ctf_file_close): Update accordingly.
  1180. * ctf-create.c (ctf_update): Likewise.
  1181. (ctf_add_type): Populate the mapping.
  1182. * ctf-hash.c (ctf_hash_type_mapping_key): Hash a type mapping key.
  1183. (ctf_hash_eq_type_mapping_key): Check the key for equality.
  1184. (ctf_dynhash_insert): Fix comment typo.
  1185. (ctf_dynhash_empty): New.
  1186. * ctf-link.c (ctf_add_type_mapping): New.
  1187. (ctf_type_mapping): Likewise.
  1188. (empty_link_type_mapping): New.
  1189. (ctf_link_one_input_archive): Call it.
  1190. 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
  1191. * ctf-link.c: New file, linking of the string and type sections.
  1192. * Makefile.am (libctf_a_SOURCES): Add it.
  1193. * Makefile.in: Regenerate.
  1194. * ctf-impl.h (ctf_file_t): New fields ctf_link_inputs,
  1195. ctf_link_outputs.
  1196. * ctf-create.c (ctf_update): Update accordingly.
  1197. * ctf-open.c (ctf_file_close): Likewise.
  1198. * ctf-error.c (_ctf_errlist): Updated with new errors.
  1199. 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
  1200. * ctf-dump.c (ctf_dump_funcs): Check the right error value.
  1201. 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
  1202. * ctf-dump.c (ctf_dump): Use ctf_type_iter_all to dump types, not
  1203. ctf_type_iter.
  1204. (ctf_dump_type): Pass down the flag from ctf_type_iter_all.
  1205. (ctf_dump_format_type): Add non-root-type { } notation.
  1206. Add root flag to prototype.
  1207. (ctf_dump_label): Adjust accordingly.
  1208. (ctf_dump_objts): Likewise.
  1209. (ctf_dump_var): Likewise.
  1210. 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
  1211. * ctf-create.c (ctf_compress_write): Fix double-free.
  1212. 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
  1213. * ctf-archive.c (ctf_arc_write): Split off, and reimplement in terms
  1214. of...
  1215. (ctf_arc_write_fd): ... this new function.
  1216. * ctf-create.c (ctf_write_mem): New.
  1217. 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
  1218. * ctf-impl.h (ctf_str_atom_t) <csa_offset>: New field.
  1219. (ctf_file_t) <ctf_syn_ext_strtab>: Likewise.
  1220. (ctf_str_add_ref): Name the last arg.
  1221. (ctf_str_add_external) New.
  1222. (ctf_str_add_strraw_explicit): Likewise.
  1223. (ctf_simple_open_internal): Likewise.
  1224. (ctf_bufopen_internal): Likewise.
  1225. * ctf-string.c (ctf_strraw_explicit): Split from...
  1226. (ctf_strraw): ... here, with new support for ctf_syn_ext_strtab.
  1227. (ctf_str_add_ref_internal): Return the atom, not the
  1228. string.
  1229. (ctf_str_add): Adjust accordingly.
  1230. (ctf_str_add_ref): Likewise. Move up in the file.
  1231. (ctf_str_add_external): New: update the csa_offset.
  1232. (ctf_str_count_strtab): Only account for strings with no csa_offset
  1233. in the internal strtab length.
  1234. (ctf_str_write_strtab): If the csa_offset is set, update the
  1235. string's refs without writing the string out, and update the
  1236. ctf_syn_ext_strtab. Make OOM handling less ugly.
  1237. * ctf-create.c (struct ctf_sort_var_arg_cb): New.
  1238. (ctf_update): Handle failure to populate the strtab. Pass in the
  1239. new ctf_sort_var arg. Adjust for ctf_syn_ext_strtab addition.
  1240. Call ctf_simple_open_internal, not ctf_simple_open.
  1241. (ctf_sort_var): Call ctf_strraw_explicit rather than looking up
  1242. strings by hand.
  1243. * ctf-hash.c (ctf_hash_insert_type): Likewise (but using
  1244. ctf_strraw). Adjust to diagnose ECTF_STRTAB nonetheless.
  1245. * ctf-open.c (init_types): No longer filter out ECTF_STRTAB.
  1246. (ctf_file_close): Destroy the ctf_syn_ext_strtab.
  1247. (ctf_simple_open): Rename to, and reimplement as a wrapper around...
  1248. (ctf_simple_open_internal): ... this new function, which calls
  1249. ctf_bufopen_internal.
  1250. (ctf_bufopen): Rename to, and reimplement as a wrapper around...
  1251. (ctf_bufopen_internal): ... this new function, which sets
  1252. ctf_syn_ext_strtab.
  1253. 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
  1254. * ctf_types.c (ctf_type_iter_all): New.
  1255. 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
  1256. * ctf-open.c (init_symtab): Check for overflow against the right
  1257. section.
  1258. (upgrade_header): Set cth_objtidxoff, cth_funcidxoff to zero-length.
  1259. (upgrade_types_v1): Note that these sections are not checked.
  1260. (flip_header): Endian-swap the header fields.
  1261. (flip_ctf): Endian-swap the sections.
  1262. (flip_objts): Update comment.
  1263. (ctf_bufopen): Check header offsets and alignment for validity.
  1264. 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
  1265. * ctf-open-bfd.c: Add <assert.h>.
  1266. (ctf_bfdopen_ctfsect): Open string and symbol tables using
  1267. techniques borrowed from bfd_elf_sym_name.
  1268. (ctf_new_archive_internal): Improve comment.
  1269. * ctf-archive.c (ctf_arc_close): Do not free the ctfi_strsect.
  1270. * ctf-open.c (ctf_bufopen): Allow opening with a string section but
  1271. no symbol section, but not vice versa.
  1272. 2019-07-08 Nick Alcock <nick.alcock@oracle.com>
  1273. * ctf-impl.h (ctf_file_t): New field ctf_openflags.
  1274. * ctf-open.c (ctf_bufopen): Set it. No longer dump header offsets.
  1275. * ctf-dump.c (dump_header): New function, dump the CTF header.
  1276. (ctf_dump): Call it.
  1277. (ctf_dump_header_strfield): New function.
  1278. (ctf_dump_header_sectfield): Likewise.
  1279. 2019-07-06 Nick Alcock <nick.alcock@oracle.com>
  1280. * ctf-impl.h (ctf_file_t): New fields ctf_header, ctf_dynbase,
  1281. ctf_cuname, ctf_dyncuname: ctf_base and ctf_buf are no longer const.
  1282. * ctf-open.c (ctf_set_base): Preserve the gap between ctf_buf and
  1283. ctf_base: do not assume that it is always sizeof (ctf_header_t).
  1284. Print out ctf_cuname: only print out ctf_parname if set.
  1285. (ctf_free_base): Removed, ctf_base is no longer freed: free
  1286. ctf_dynbase instead.
  1287. (ctf_set_version): Fix spacing.
  1288. (upgrade_header): New, in-place header upgrading.
  1289. (upgrade_types): Rename to...
  1290. (upgrade_types_v1): ... this. Free ctf_dynbase, not ctf_base. No
  1291. longer track old and new headers separately. No longer allow for
  1292. header sizes explicitly: squeeze the headers out on upgrade (they
  1293. are preserved in fp->ctf_header). Set ctf_dynbase, ctf_base and
  1294. ctf_buf explicitly. Use ctf_free, not ctf_free_base.
  1295. (upgrade_types): New, also handle ctf_parmax updating.
  1296. (flip_header): Flip ctf_cuname.
  1297. (flip_types): Flip BUF explicitly rather than deriving BUF from
  1298. BASE.
  1299. (ctf_bufopen): Store the header in fp->ctf_header. Correct minimum
  1300. required alignment of objtoff and funcoff. No longer store it in
  1301. the ctf_buf unless that buf is derived unmodified from the input.
  1302. Set ctf_dynbase where ctf_base is dynamically allocated. Drop locals
  1303. that duplicate fields in ctf_file: move allocation of ctf_file
  1304. further up instead. Call upgrade_header as needed. Move
  1305. version-specific ctf_parmax initialization into upgrade_types. More
  1306. concise error handling.
  1307. (ctf_file_close): No longer test for null pointers before freeing.
  1308. Free ctf_dyncuname, ctf_dynbase, and ctf_header. Do not call
  1309. ctf_free_base.
  1310. (ctf_cuname): New.
  1311. (ctf_cuname_set): New.
  1312. * ctf-create.c (ctf_update): Populate ctf_cuname.
  1313. (ctf_gzwrite): Write out the header explicitly. Remove obsolescent
  1314. comment.
  1315. (ctf_write): Likewise.
  1316. (ctf_compress_write): Get the header from ctf_header, not ctf_base.
  1317. Fix the compression length: fp->ctf_size never counted the CTF
  1318. header. Simplify the compress call accordingly.
  1319. 2019-07-11 Hans-Peter Nilsson <hp@bitrange.com>
  1320. * ctf-endian.h: Don't assume htole64 and le64toh are always
  1321. present if HAVE_ENDIAN_H; also check if htole64 is defined.
  1322. [!WORDS_BIGENDIAN] (htole64, le64toh): Define as identity,
  1323. not bswap_identity_64.
  1324. 2019-09-18 Alan Modra <amodra@gmail.com>
  1325. * ctf-open-bfd.c: Update throughout for bfd section macro changes.
  1326. 2019-09-09 Phil Blundell <pb@pbcl.net>
  1327. binutils 2.33 branch created.
  1328. 2019-07-18 Nick Alcock <nick.alcock@oracle.com>
  1329. * ctf-types.c (ctf_type_aname_raw): New.
  1330. (ctf_func_type_info): Likewise.
  1331. (ctf_func_type_args): Likewise.
  1332. * ctf-error.c (_ctf_errlist): Fix description.
  1333. * ctf-lookup.c: Fix file description.
  1334. 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
  1335. * ctf-create.c (ctf_create): Fix off-by-one error.
  1336. 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
  1337. * ctf-impl.h: (struct ctf_strs_writable): New, non-const version of
  1338. struct ctf_strs.
  1339. (struct ctf_dtdef): Note that dtd_data.ctt_name is unpopulated.
  1340. (struct ctf_str_atom): New, disambiguated single string.
  1341. (struct ctf_str_atom_ref): New, points to some other location that
  1342. references this string's offset.
  1343. (struct ctf_file): New members ctf_str_atoms and ctf_str_num_refs.
  1344. Remove member ctf_dtvstrlen: we no longer track the total strlen
  1345. as we add strings.
  1346. (ctf_str_create_atoms): Declare new function in ctf-string.c.
  1347. (ctf_str_free_atoms): Likewise.
  1348. (ctf_str_add): Likewise.
  1349. (ctf_str_add_ref): Likewise.
  1350. (ctf_str_rollback): Likewise.
  1351. (ctf_str_purge_refs): Likewise.
  1352. (ctf_str_write_strtab): Likewise.
  1353. (ctf_realloc): Declare new function in ctf-util.c.
  1354. * ctf-open.c (ctf_bufopen): Create the atoms table.
  1355. (ctf_file_close): Destroy it.
  1356. * ctf-create.c (ctf_update): Copy-and-free it on update. No longer
  1357. special-case the position of the parname string. Construct the
  1358. strtab by calling ctf_str_add_ref and ctf_str_write_strtab after the
  1359. rest of each buffer element is constructed, not via open-coding:
  1360. realloc the CTF buffer and append the strtab to it. No longer
  1361. maintain ctf_dtvstrlen. Sort the variable entry table later, after
  1362. strtab construction.
  1363. (ctf_copy_membnames): Remove: integrated into ctf_copy_{s,l,e}members.
  1364. (ctf_copy_smembers): Drop the string offset: call ctf_str_add_ref
  1365. after buffer element construction instead.
  1366. (ctf_copy_lmembers): Likewise.
  1367. (ctf_copy_emembers): Likewise.
  1368. (ctf_create): No longer maintain the ctf_dtvstrlen.
  1369. (ctf_dtd_delete): Likewise.
  1370. (ctf_dvd_delete): Likewise.
  1371. (ctf_add_generic): Likewise.
  1372. (ctf_add_enumerator): Likewise.
  1373. (ctf_add_member_offset): Likewise.
  1374. (ctf_add_variable): Likewise.
  1375. (membadd): Likewise.
  1376. * ctf-util.c (ctf_realloc): New, wrapper around realloc that aborts
  1377. if there are active ctf_str_num_refs.
  1378. (ctf_strraw): Move to ctf-string.c.
  1379. (ctf_strptr): Likewise.
  1380. * ctf-string.c: New file, strtab manipulation.
  1381. * Makefile.am (libctf_a_SOURCES): Add it.
  1382. * Makefile.in: Regenerate.
  1383. 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
  1384. * ctf-impl.h (ctf_hash_iter_f): New.
  1385. (ctf_dynhash_iter): New declaration.
  1386. (ctf_dynhash_iter_remove): New declaration.
  1387. * ctf-hash.c (ctf_dynhash_iter): Define.
  1388. (ctf_dynhash_iter_remove): Likewise.
  1389. (ctf_hashtab_traverse): New.
  1390. (ctf_hashtab_traverse_remove): Likewise.
  1391. (struct ctf_traverse_cb_arg): Likewise.
  1392. (struct ctf_traverse_remove_cb_arg): Likewise.
  1393. 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
  1394. * ctf-hash.c (ctf_dynhash_remove): Call with a mocked-up element.
  1395. 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
  1396. * ctf-dump.c (ctf_dump_format_type): Prefix hex strings with 0x.
  1397. (ctf_dump_funcs): Likewise.
  1398. 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
  1399. * ctf-open-bfd.c: Add swap.h and ctf-endian.h.
  1400. (ctf_fdopen): Check for endian-swapped raw CTF magic, and
  1401. little-endian CTF archive magic. Do not check the CTF version:
  1402. ctf_simple_open does that in endian-safe ways. Do not dereference
  1403. null pointers on open failure.
  1404. 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
  1405. * ctf-open.c (get_vbytes_common): Return the new slice size.
  1406. (ctf_bufopen): Flip the endianness of the CTF-section header copy.
  1407. Remember to copy in the CTF data when opening an uncompressed
  1408. foreign-endian CTF file. Prune useless variable manipulation.
  1409. 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
  1410. * ctf-open.c (ctf_types): Fail when unidentified type kinds are
  1411. seen.
  1412. 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
  1413. * ctf-open.c (ctf_bufopen): Dump header offsets into the debugging
  1414. output.
  1415. 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
  1416. * ctf-subr.c (_PAGESIZE): Remove.
  1417. (ctf_data_alloc): Likewise.
  1418. (ctf_data_free): Likewise.
  1419. (ctf_data_protect): Likewise.
  1420. * ctf-impl.h: Remove declarations.
  1421. * ctf-create.c (ctf_update): No longer call ctf_data_protect: use
  1422. ctf_free, not ctf_data_free.
  1423. (ctf_compress_write): Use ctf_data_alloc, not ctf_alloc. Free
  1424. the buffer again on compression error.
  1425. * ctf-open.c (ctf_set_base): No longer track the size: call
  1426. ctf_free, not ctf_data_free.
  1427. (upgrade_types): Likewise. Call ctf_alloc, not ctf_data_alloc.
  1428. (ctf_bufopen): Likewise. No longer call ctf_data_protect.
  1429. 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
  1430. * ctf-create.c (ctf_dtd_insert): Pass on error returns from
  1431. ctf_dynhash_insert.
  1432. (ctf_dvd_insert): Likewise.
  1433. (ctf_add_generic): Likewise.
  1434. (ctf_add_variable): Likewise.
  1435. * ctf-impl.h: Adjust declarations.
  1436. 2019-06-14 Alan Modra <amodra@gmail.com>
  1437. * configure: Regenerate.
  1438. 2019-06-06 Nick Alcock <nick.alcock@oracle.com>
  1439. * ctf-decls.h: Include <libiberty.h>.
  1440. * ctf-lookup.c (ctf_lookup_by_name): Call xstrndup(), not strndup().
  1441. 2019-06-06 Nick Alcock <nick.alcock@oracle.com>
  1442. * ctf-dump.c (ctf_dump_format_type): Cast size_t's used in printf()s.
  1443. (ctf_dump_objts): Likewise.
  1444. (ctf_dump_funcs): Likewise.
  1445. (ctf_dump_member): Likewise.
  1446. (ctf_dump_str): Likewise.
  1447. 2019-06-06 Nick Alcock <nick.alcock@oracle.com>
  1448. * ctf-archive.c (arc_mmap_header): Mark fd as potentially unused.
  1449. * ctf-subr.c (ctf_data_protect): Mark both args as potentially unused.
  1450. 2019-06-05 Nick Alcock <nick.alcock@oracle.com>
  1451. * ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
  1452. (ctf_arc_open_by_offset): Likewise.
  1453. * ctf-create.c (ctf_add_type): Likewise.
  1454. 2019-06-04 Tom Tromey <tromey@adacore.com>
  1455. * ctf-create.c (ctf_add_encoded, ctf_add_slice)
  1456. (ctf_add_member_offset): Use CHAR_BIT, not NBBY.
  1457. 2019-06-04 Nick Alcock <nick.alcock@oracle.com>
  1458. * configure.ac: Check for O_CLOEXEC.
  1459. * ctf-decls.h (O_CLOEXEC): Define (to 0), if need be.
  1460. * config.h.in: Regenerate.
  1461. * configure: Likewise.
  1462. 2019-06-04 Nick Alcock <nick.alcock@oracle.com>
  1463. * qsort_r.c: Rename to...
  1464. * ctf-qsort_r.c: ... this.
  1465. (_quicksort): Define to ctf_qsort_r.
  1466. * ctf-decls.h (qsort_r): Remove.
  1467. (ctf_qsort_r): Add.
  1468. (struct ctf_qsort_arg): New, transport the real ARG and COMPAR.
  1469. (ctf_qsort_compar_thunk): Rearrange the arguments to COMPAR.
  1470. * Makefile.am (libctf_a_LIBADD): Remove.
  1471. (libctf_a_SOURCES): New, add ctf-qsort_r.c.
  1472. * ctf-archive.c (ctf_arc_write): Call ctf_qsort_r, not qsort_r.
  1473. * ctf-create.c (ctf_update): Likewise.
  1474. * configure.ac: Check for BSD versus GNU qsort_r signature.
  1475. * Makefile.in: Regenerate.
  1476. * config.h.in: Likewise.
  1477. * configure: Likewise.
  1478. 2019-06-03 Nick Alcock <nick.alcock@oracle.com>
  1479. * ctf-dump.c (ctf_dump_funcs): Free in the right place.
  1480. 2019-05-29 Nick Alcock <nick.alcock@oracle.com>
  1481. * Makefile.am (ZLIB): New.
  1482. (ZLIBINC): Likewise.
  1483. (AM_CFLAGS): Use them.
  1484. (libctf_a_LIBADD): New, for LIBOBJS.
  1485. * configure.ac: Check for zlib, endian.h, and qsort_r.
  1486. * ctf-endian.h: New, providing htole64 and le64toh.
  1487. * swap.h: Code style fixes.
  1488. (bswap_identity_64): New.
  1489. * qsort_r.c: New, from gnulib (with one added #include).
  1490. * ctf-decls.h: New, providing a conditional qsort_r declaration,
  1491. and unconditional definitions of MIN and MAX.
  1492. * ctf-impl.h: Use it. Do not use <sys/errno.h>.
  1493. (ctf_set_errno): Now returns unsigned long.
  1494. * ctf-util.c (ctf_set_errno): Adjust here too.
  1495. * ctf-archive.c: Use ctf-endian.h.
  1496. (ctf_arc_open_by_offset): Use memset, not bzero. Drop cts_type,
  1497. cts_flags and cts_offset.
  1498. (ctf_arc_write): Drop debugging dependent on the size of off_t.
  1499. * ctf-create.c: Provide a definition of roundup if not defined.
  1500. (ctf_create): Drop cts_type, cts_flags and cts_offset.
  1501. (ctf_add_reftype): Do not check if type IDs are below zero.
  1502. (ctf_add_slice): Likewise.
  1503. (ctf_add_typedef): Likewise.
  1504. (ctf_add_member_offset): Cast error-returning ssize_t's to size_t
  1505. when known error-free. Drop CTF_ERR usage for functions returning
  1506. int.
  1507. (ctf_add_member_encoded): Drop CTF_ERR usage for functions returning
  1508. int.
  1509. (ctf_add_variable): Likewise.
  1510. (enumcmp): Likewise.
  1511. (enumadd): Likewise.
  1512. (membcmp): Likewise.
  1513. (ctf_add_type): Likewise. Cast error-returning ssize_t's to size_t
  1514. when known error-free.
  1515. * ctf-dump.c (ctf_is_slice): Drop CTF_ERR usage for functions
  1516. returning int: use CTF_ERR for functions returning ctf_type_id.
  1517. (ctf_dump_label): Likewise.
  1518. (ctf_dump_objts): Likewise.
  1519. * ctf-labels.c (ctf_label_topmost): Likewise.
  1520. (ctf_label_iter): Likewise.
  1521. (ctf_label_info): Likewise.
  1522. * ctf-lookup.c (ctf_func_args): Likewise.
  1523. * ctf-open.c (upgrade_types): Cast to size_t where appropriate.
  1524. (ctf_bufopen): Likewise. Use zlib types as needed.
  1525. * ctf-types.c (ctf_member_iter): Drop CTF_ERR usage for functions
  1526. returning int.
  1527. (ctf_enum_iter): Likewise.
  1528. (ctf_type_size): Likewise.
  1529. (ctf_type_align): Likewise. Cast to size_t where appropriate.
  1530. (ctf_type_kind_unsliced): Likewise.
  1531. (ctf_type_kind): Likewise.
  1532. (ctf_type_encoding): Likewise.
  1533. (ctf_member_info): Likewise.
  1534. (ctf_array_info): Likewise.
  1535. (ctf_enum_value): Likewise.
  1536. (ctf_type_rvisit): Likewise.
  1537. * ctf-open-bfd.c (ctf_bfdopen): Drop cts_type, cts_flags and
  1538. cts_offset.
  1539. (ctf_simple_open): Likewise.
  1540. (ctf_bfdopen_ctfsect): Likewise. Set cts_size properly.
  1541. * Makefile.in: Regenerate.
  1542. * aclocal.m4: Likewise.
  1543. * config.h: Likewise.
  1544. * configure: Likewise.
  1545. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1546. * configure.in: Check for bfd_section_from_elf_index.
  1547. * configure: Regenerate.
  1548. * config.h.in [HAVE_BFD_ELF]: Likewise.
  1549. * libctf/ctf-open-bfd.c (ctf_bfdopen_ctfsect): Use it.
  1550. abfd is potentially unused now.
  1551. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1552. * Makefile.am: New.
  1553. * Makefile.in: Regenerated.
  1554. * config.h.in: Likewise.
  1555. * aclocal.m4: Likewise.
  1556. * configure: Likewise.
  1557. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1558. * ctf-dump.c: New.
  1559. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1560. * ctf-labels.c: New.
  1561. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1562. * ctf-impl.h (_libctf_version): New declaration.
  1563. * ctf-subr.c (_libctf_version): Define it.
  1564. (ctf_version): New.
  1565. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1566. * ctf-create.c (enumcmp): New.
  1567. (enumadd): Likewise.
  1568. (membcmp): Likewise.
  1569. (membadd): Likewise.
  1570. (ctf_add_type): Likewise.
  1571. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1572. * ctf-lookup.c (isqualifier): New.
  1573. (ctf_lookup_by_name): Likewise.
  1574. (struct ctf_lookup_var_key): Likewise.
  1575. (ctf_lookup_var): Likewise.
  1576. (ctf_lookup_variable): Likewise.
  1577. (ctf_lookup_symbol_name): Likewise.
  1578. (ctf_lookup_by_symbol): Likewise.
  1579. (ctf_func_info): Likewise.
  1580. (ctf_func_args): Likewise.
  1581. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1582. * ctf-decl.c: New file.
  1583. * ctf-types.c: Likewise.
  1584. * ctf-impl.h: New declarations.
  1585. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1586. * ctf-open-bfd.c: New file.
  1587. * ctf-open.c (ctf_close): New.
  1588. * ctf-impl.h: Include bfd.h.
  1589. (ctf_file): New members ctf_data_mmapped, ctf_data_mmapped_len.
  1590. (ctf_archive_internal): New members ctfi_abfd, ctfi_data,
  1591. ctfi_bfd_close.
  1592. (ctf_bfdopen_ctfsect): New declaration.
  1593. (_CTF_SECTION): likewise.
  1594. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1595. * ctf-archive.c: New.
  1596. * ctf-impl.h (ctf_archive_internal): New type.
  1597. (ctf_arc_open_internal): New declaration.
  1598. (ctf_arc_bufopen): Likewise.
  1599. (ctf_arc_close_internal): Likewise.
  1600. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1601. * ctf-open.c: New file.
  1602. * swap.h: Likewise.
  1603. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1604. * ctf-create.c: New file.
  1605. * ctf-lookup.c: New file.
  1606. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1607. * ctf-impl.h: New definitions and declarations for type creation
  1608. and lookup.
  1609. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1610. * ctf-hash.c: New file.
  1611. * ctf-impl.h: New declarations.
  1612. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1613. * ctf-error.c: New file.
  1614. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1615. * ctf-util.c: New file.
  1616. * elf.h: Likewise.
  1617. * ctf-impl.h: Include it, and add declarations.
  1618. 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
  1619. * ctf-impl.h: New file.
  1620. * ctf-subr.c: New file.
  1621. Local Variables:
  1622. mode: change-log
  1623. left-margin: 8
  1624. fill-column: 76
  1625. version-control: never
  1626. End: