1*c42dbd0eSchristos2022-07-08 Nick Clifton <nickc@redhat.com> 2867d70fcSchristos 3*c42dbd0eSchristos * 2.39 branch created. 4867d70fcSchristos 5*c42dbd0eSchristos2022-01-22 Nick Clifton <nickc@redhat.com> 6867d70fcSchristos 7*c42dbd0eSchristos * 2.38 release branch created. 8867d70fcSchristos 9*c42dbd0eSchristos2021-11-08 Nick Alcock <nick.alcock@oracle.com> 10867d70fcSchristos 11*c42dbd0eSchristos * doc/ctf-spec.texi: New file. 12*c42dbd0eSchristos * configure.ac (MAKEINFO): Add. 13*c42dbd0eSchristos (BUILD_INFO): Likewise. 14*c42dbd0eSchristos (AC_CONFIG_FILES) [doc/Makefile]: Add. 15*c42dbd0eSchristos * Makefile.am [BUILD_INFO] (SUBDIRS): Add doc/. 16*c42dbd0eSchristos * doc/Makefile.am: New file. 17*c42dbd0eSchristos * doc/Makefile.in: Likewise. 18*c42dbd0eSchristos * configure: Regenerated. 19*c42dbd0eSchristos * Makefile.in: Likewise. 20867d70fcSchristos 21*c42dbd0eSchristos2021-10-25 Nick Alcock <nick.alcock@oracle.com> 22*c42dbd0eSchristos 23*c42dbd0eSchristos * ctf-types.c (ctf_type_rvisit): Handle nonrepresentable types. 24*c42dbd0eSchristos 25*c42dbd0eSchristos2021-10-25 Nick Alcock <nick.alcock@oracle.com> 26*c42dbd0eSchristos 27*c42dbd0eSchristos * ctf-dump.c (ctf_dump_type): Do not abort on error. 28*c42dbd0eSchristos 29*c42dbd0eSchristos2021-09-27 Nick Alcock <nick.alcock@oracle.com> 30*c42dbd0eSchristos 31*c42dbd0eSchristos * ctf-lookup.c (ctf_lookup_by_name_internal): Fix pptrtab bounds. 32*c42dbd0eSchristos * testsuite/libctf-writable/pptrtab-writable-page-deep-lookup.*: 33*c42dbd0eSchristos New test. 34*c42dbd0eSchristos 35*c42dbd0eSchristos2021-09-27 Nick Alcock <nick.alcock@oracle.com> 36*c42dbd0eSchristos 37*c42dbd0eSchristos * testsuite/libctf-lookup/enum-symbol.c: Remove unused label. 38*c42dbd0eSchristos * testsuite/libctf-lookup/conflicting-type-syms.c: Remove unused 39*c42dbd0eSchristos variables. 40*c42dbd0eSchristos * testsuite/libctf-regression/pptrtab.c: Likewise. 41*c42dbd0eSchristos * testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise. 42*c42dbd0eSchristos * testsuite/libctf-writable/pptrtab.c: Likewise. 43*c42dbd0eSchristos * testsuite/libctf-writable/reserialize-strtab-corruption.c: 44*c42dbd0eSchristos Likewise. 45*c42dbd0eSchristos * testsuite/libctf-regression/nonstatic-var-section-ld-r.c: Fix 46*c42dbd0eSchristos format string. 47*c42dbd0eSchristos * testsuite/libctf-regression/nonstatic-var-section-ld.c: 48*c42dbd0eSchristos Likewise. 49*c42dbd0eSchristos * testsuite/libctf-regression/nonstatic-var-section-ld.lk: Adjust. 50*c42dbd0eSchristos * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Fix 51*c42dbd0eSchristos initializer. 52*c42dbd0eSchristos 53*c42dbd0eSchristos2021-09-27 Nick Alcock <nick.alcock@oracle.com> 54*c42dbd0eSchristos 55*c42dbd0eSchristos * ctf-open.c (ctf_bufopen_internal): Don't complain about corrupt 56*c42dbd0eSchristos function index symtypetab sections if this is an old-format 57*c42dbd0eSchristos function symtypetab section (which should be ignored in any case). 58*c42dbd0eSchristos Fix bad grammar. 59*c42dbd0eSchristos 60*c42dbd0eSchristos2021-09-27 Nick Alcock <nick.alcock@oracle.com> 61*c42dbd0eSchristos 62*c42dbd0eSchristos * configure: Regenerate. 63*c42dbd0eSchristos * Makefile.in: Regenerate. 64*c42dbd0eSchristos 65*c42dbd0eSchristos2021-09-27 Nick Alcock <nick.alcock@oracle.com> 66*c42dbd0eSchristos 67*c42dbd0eSchristos PR libctf/27967 68*c42dbd0eSchristos * configure.ac (VERSION_FLAGS): Replace with... 69*c42dbd0eSchristos (ac_cv_libctf_version_script): ... this multiple test. 70*c42dbd0eSchristos (VERSION_FLAGS_NOBFD): Substitute this too. 71*c42dbd0eSchristos * Makefile.am (libctf_nobfd_la_LDFLAGS): Use it. Split out... 72*c42dbd0eSchristos (libctf_ldflags_nover): ... non-versioning flags here. 73*c42dbd0eSchristos (libctf_la_LDFLAGS): Use it. 74*c42dbd0eSchristos * libctf.ver: Give every symbol not in libctf-nobfd a comment on 75*c42dbd0eSchristos the same line noting as much. 76*c42dbd0eSchristos 77*c42dbd0eSchristos2021-09-27 Nick Alcock <nick.alcock@oracle.com> 78*c42dbd0eSchristos 79*c42dbd0eSchristos PR libctf/27360 80*c42dbd0eSchristos * Makefile.am (libctf_la_LIBADD): Link against libiberty 81*c42dbd0eSchristos before pulling in libbfd.la or pulling in libctf-nobfd.la. 82*c42dbd0eSchristos * Makefile.in: Regenerate. 83*c42dbd0eSchristos 84*c42dbd0eSchristos2021-07-03 Nick Clifton <nickc@redhat.com> 85*c42dbd0eSchristos 86*c42dbd0eSchristos * 2.37 release branch created. 87*c42dbd0eSchristos 88*c42dbd0eSchristos2021-05-09 Alan Modra <amodra@gmail.com> 89*c42dbd0eSchristos 90*c42dbd0eSchristos * ctf-impl.h (ctf_dynset_eq_string): Don't declare. 91*c42dbd0eSchristos * ctf-hash.c (ctf_dynset_eq_string): Delete function. 92*c42dbd0eSchristos * ctf-dedup.c (make_set_element): Use htab_eq_string. 93*c42dbd0eSchristos (ctf_dedup_atoms_init, ADD_CITER, ctf_dedup_init): Likewise. 94*c42dbd0eSchristos (ctf_dedup_conflictify_unshared): Likewise. 95*c42dbd0eSchristos (ctf_dedup_walk_output_mapping): Likewise. 96*c42dbd0eSchristos 97*c42dbd0eSchristos2021-05-06 Nick Alcock <nick.alcock@oracle.com> 98*c42dbd0eSchristos 99*c42dbd0eSchristos * testsuite/lib/ctf-lib.exp: Use -gctf, not -gt. 100*c42dbd0eSchristos * testsuite/libctf-regression/nonstatic-var-section-ld-r.lk: 101*c42dbd0eSchristos Hidden symbols now get into the symtypetab anyway. 102*c42dbd0eSchristos 103*c42dbd0eSchristos2021-05-06 Nick Alcock <nick.alcock@oracle.com> 104*c42dbd0eSchristos 105*c42dbd0eSchristos * ctf-open.c (init_types): Unknown types may have names. 106*c42dbd0eSchristos * ctf-types.c (ctf_type_resolve): CTF_K_UNKNOWN is as 107*c42dbd0eSchristos non-representable as type ID 0. 108*c42dbd0eSchristos (ctf_type_aname): Print unknown types. 109*c42dbd0eSchristos * ctf-dedup.c (ctf_dedup_hash_type): Do not early-exit for 110*c42dbd0eSchristos CTF_K_UNKNOWN types: they have real hash values now. 111*c42dbd0eSchristos (ctf_dedup_rwalk_one_output_mapping): Treat CTF_K_UNKNOWN types 112*c42dbd0eSchristos like other types with no referents: call the callback and do not 113*c42dbd0eSchristos skip them. 114*c42dbd0eSchristos (ctf_dedup_emit_type): Emit via... 115*c42dbd0eSchristos * ctf-create.c (ctf_add_unknown): ... this new function. 116*c42dbd0eSchristos * libctf.ver (LIBCTF_1.2): Add it. 117*c42dbd0eSchristos 118*c42dbd0eSchristos2021-03-25 Nick Alcock <nick.alcock@oracle.com> 119*c42dbd0eSchristos 120*c42dbd0eSchristos * configure.ac: Check for dlsym, not dlopen. 121*c42dbd0eSchristos * configure: Regenerate. 122*c42dbd0eSchristos 123*c42dbd0eSchristos2021-03-25 Nick Alcock <nick.alcock@oracle.com> 124*c42dbd0eSchristos 125*c42dbd0eSchristos * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Don't 126*c42dbd0eSchristos leak buf. 127*c42dbd0eSchristos 128*c42dbd0eSchristos2021-03-25 Nick Alcock <nick.alcock@oracle.com> 129*c42dbd0eSchristos 130*c42dbd0eSchristos PR libctf/27628 131*c42dbd0eSchristos * ctf-lookup.c (isqualifier): Don't dereference out-of-bounds 132*c42dbd0eSchristos qhash values. 133*c42dbd0eSchristos 134*c42dbd0eSchristos2021-03-25 Nick Alcock <nick.alcock@oracle.com> 135*c42dbd0eSchristos 136*c42dbd0eSchristos * ctf-open-bfd.c (ctf_bfdopen_ctfsect): Initialize debugging. 137*c42dbd0eSchristos 138*c42dbd0eSchristos2021-03-25 Nick Alcock <nick.alcock@oracle.com> 139*c42dbd0eSchristos 140*c42dbd0eSchristos PR libctf/27628 141*c42dbd0eSchristos * ctf-serialize.c (ctf_emit_type_sect): Allow for a NULL vlen in 142*c42dbd0eSchristos CTF_K_FUNCTION types. 143*c42dbd0eSchristos 144*c42dbd0eSchristos2021-03-25 Nick Alcock <nick.alcock@oracle.com> 145*c42dbd0eSchristos 146*c42dbd0eSchristos * ctf-dump.c (ctf_dump_format_type): Don't emit size or alignment 147*c42dbd0eSchristos on error. 148*c42dbd0eSchristos 149*c42dbd0eSchristos2021-03-21 Alan Modra <amodra@gmail.com> 150*c42dbd0eSchristos 151*c42dbd0eSchristos * ctf-impl.h: Include string.h. 152*c42dbd0eSchristos 153*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 154*c42dbd0eSchristos 155*c42dbd0eSchristos * ctf-types.c (ctf_type_encoding): Support, after a fashion, for enums. 156*c42dbd0eSchristos * ctf-dump.c (ctf_dump_format_type): Do not report enums' degenerate 157*c42dbd0eSchristos encoding. 158*c42dbd0eSchristos 159*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 160*c42dbd0eSchristos 161*c42dbd0eSchristos * ctf-dedup.c (ctf_dedup_rhash_type): Report errors on the input 162*c42dbd0eSchristos dict properly. 163*c42dbd0eSchristos * ctf-open.c (ctf_bufopen_internal): Report errors initializing 164*c42dbd0eSchristos the atoms table. 165*c42dbd0eSchristos 166*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 167*c42dbd0eSchristos 168*c42dbd0eSchristos * ctf-impl.h (ctf_next_t) <ctn_tp>: New. 169*c42dbd0eSchristos <u.ctn_mp>: Remove. 170*c42dbd0eSchristos <u.ctn_lmp>: Remove. 171*c42dbd0eSchristos <u.ctn_vlen>: New. 172*c42dbd0eSchristos * ctf-types.c (ctf_struct_member): New. 173*c42dbd0eSchristos (ctf_member_next): Use it, dropping separate large/small code paths. 174*c42dbd0eSchristos (ctf_type_align): Likewise. 175*c42dbd0eSchristos (ctf_member_info): Likewise. 176*c42dbd0eSchristos (ctf_type_rvisit): Likewise. 177*c42dbd0eSchristos 178*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 179*c42dbd0eSchristos 180*c42dbd0eSchristos * ctf-impl.h (ctf_dtdef_t) <dtu_members>: Remove. 181*c42dbd0eSchristos <dtd_u>: Likewise. 182*c42dbd0eSchristos (ctf_dmdef_t): Remove. 183*c42dbd0eSchristos (struct ctf_next) <u.ctn_dmd>: Remove. 184*c42dbd0eSchristos * ctf-create.c (INITIAL_VLEN): New, more-or-less arbitrary initial 185*c42dbd0eSchristos vlen size. 186*c42dbd0eSchristos (ctf_add_enum): Use it. 187*c42dbd0eSchristos (ctf_dtd_delete): Do not free the (removed) dmd; remove string 188*c42dbd0eSchristos refs from the vlen on struct deletion. 189*c42dbd0eSchristos (ctf_add_struct_sized): Populate the vlen: do it by hand if 190*c42dbd0eSchristos promoting forwards. Always populate the full-size 191*c42dbd0eSchristos lsizehi/lsizelo members. 192*c42dbd0eSchristos (ctf_add_union_sized): Likewise. 193*c42dbd0eSchristos (ctf_add_member_offset): Set up the vlen rather than the dmd. 194*c42dbd0eSchristos Expand it as needed, repointing string refs via 195*c42dbd0eSchristos ctf_str_move_pending. Add the member names as pending strings. 196*c42dbd0eSchristos Always populate the full-size lsizehi/lsizelo members. 197*c42dbd0eSchristos (membadd): Remove, folding back into... 198*c42dbd0eSchristos (ctf_add_type_internal): ... here, adding via an ordinary 199*c42dbd0eSchristos ctf_add_struct_sized and _next iteration rather than doing 200*c42dbd0eSchristos everything by hand. 201*c42dbd0eSchristos * ctf-serialize.c (ctf_copy_smembers): Remove this... 202*c42dbd0eSchristos (ctf_copy_lmembers): ... and this... 203*c42dbd0eSchristos (ctf_emit_type_sect): ... folding into here. Figure out if a 204*c42dbd0eSchristos ctf_stype_t is needed here, not in ctf_add_*_sized. 205*c42dbd0eSchristos (ctf_type_sect_size): Figure out the ctf_stype_t stuff the same 206*c42dbd0eSchristos way here. 207*c42dbd0eSchristos * ctf-types.c (ctf_member_next): Remove the dmd path and always 208*c42dbd0eSchristos use the vlen. Force large-structure usage for dynamic types. 209*c42dbd0eSchristos (ctf_type_align): Likewise. 210*c42dbd0eSchristos (ctf_member_info): Likewise. 211*c42dbd0eSchristos (ctf_type_rvisit): Likewise. 212*c42dbd0eSchristos * testsuite/libctf-regression/type-add-unnamed-struct-ctf.c: Add a 213*c42dbd0eSchristos self-referential type to this test. 214*c42dbd0eSchristos * testsuite/libctf-regression/type-add-unnamed-struct.c: Adjusted 215*c42dbd0eSchristos accordingly. 216*c42dbd0eSchristos * testsuite/libctf-regression/type-add-unnamed-struct.lk: Likewise. 217*c42dbd0eSchristos 218*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 219*c42dbd0eSchristos 220*c42dbd0eSchristos * ctf-impl.h (ctf_dtdef_t) <dtd_vlen_alloc>: New. 221*c42dbd0eSchristos (ctf_str_move_pending): Declare. 222*c42dbd0eSchristos * ctf-string.c (ctf_str_add_ref_internal): Fix error return. 223*c42dbd0eSchristos (ctf_str_move_pending): New. 224*c42dbd0eSchristos * ctf-create.c (ctf_grow_vlen): New. 225*c42dbd0eSchristos (ctf_dtd_delete): Zero out the vlen_alloc after free. Free the 226*c42dbd0eSchristos vlen later: iterate over it and free enum name refs first. 227*c42dbd0eSchristos (ctf_add_generic): Populate dtd_vlen_alloc from vlen. 228*c42dbd0eSchristos (ctf_add_enum): populate the vlen; do it by hand if promoting 229*c42dbd0eSchristos forwards. 230*c42dbd0eSchristos (ctf_add_enumerator): Set up the vlen rather than the dmd. Expand 231*c42dbd0eSchristos it as needed, repointing string refs via ctf_str_move_pending. Add 232*c42dbd0eSchristos the enumerand names as pending strings. 233*c42dbd0eSchristos * ctf-serialize.c (ctf_copy_emembers): Remove. 234*c42dbd0eSchristos (ctf_emit_type_sect): Copy the vlen into place and ref the 235*c42dbd0eSchristos strings. 236*c42dbd0eSchristos * ctf-types.c (ctf_enum_next): The dynamic portion now uses 237*c42dbd0eSchristos the same code as the non-dynamic. 238*c42dbd0eSchristos (ctf_enum_name): Likewise. 239*c42dbd0eSchristos (ctf_enum_value): Likewise. 240*c42dbd0eSchristos * testsuite/libctf-lookup/enum-many-ctf.c: New test. 241*c42dbd0eSchristos * testsuite/libctf-lookup/enum-many.lk: New test. 242*c42dbd0eSchristos 243*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 244*c42dbd0eSchristos 245*c42dbd0eSchristos * ctf-hash.c (ctf_dynset_elements): New. 246*c42dbd0eSchristos * ctf-impl.h (ctf_dynset_elements): Declare it. 247*c42dbd0eSchristos (ctf_str_add_pending): Likewise. 248*c42dbd0eSchristos (ctf_dict_t) <ctf_str_pending_ref>: New, set of refs that must be 249*c42dbd0eSchristos added during serialization. 250*c42dbd0eSchristos * ctf-string.c (ctf_str_create_atoms): Initialize it. 251*c42dbd0eSchristos (CTF_STR_ADD_REF): New flag. 252*c42dbd0eSchristos (CTF_STR_MAKE_PROVISIONAL): Likewise. 253*c42dbd0eSchristos (CTF_STR_PENDING_REF): Likewise. 254*c42dbd0eSchristos (ctf_str_add_ref_internal): Take a flags word rather than int 255*c42dbd0eSchristos params. Populate, and clear out, ctf_str_pending_ref. 256*c42dbd0eSchristos (ctf_str_add): Adjust accordingly. 257*c42dbd0eSchristos (ctf_str_add_external): Likewise. 258*c42dbd0eSchristos (ctf_str_add_pending): New. 259*c42dbd0eSchristos (ctf_str_remove_ref): Also remove the potential ref if it is a 260*c42dbd0eSchristos pending ref. 261*c42dbd0eSchristos * ctf-serialize.c (ctf_serialize): Prohibit addition of strings 262*c42dbd0eSchristos with ctf_str_add_ref before serialization. Ensure that the 263*c42dbd0eSchristos ctf_str_pending_ref set is empty before strtab finalization. 264*c42dbd0eSchristos (ctf_emit_type_sect): Add a ref to the ctt_name. 265*c42dbd0eSchristos * ctf-create.c (ctf_add_generic): Add the ctt_name as a pending 266*c42dbd0eSchristos ref. 267*c42dbd0eSchristos * testsuite/libctf-writable/reserialize-strtab-corruption.*: New test. 268*c42dbd0eSchristos 269*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 270*c42dbd0eSchristos 271*c42dbd0eSchristos * ctf-serialize.c (ctf_serialize): Preserve ctf_typemax across 272*c42dbd0eSchristos serialization. 273*c42dbd0eSchristos 274*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 275*c42dbd0eSchristos 276*c42dbd0eSchristos * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_argv>: Remove. 277*c42dbd0eSchristos * ctf-create.c (ctf_dtd_delete): No longer free it. 278*c42dbd0eSchristos (ctf_add_function): Use the dtd_vlen, not dtu_argv. Properly align. 279*c42dbd0eSchristos * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen. 280*c42dbd0eSchristos * ctf-types.c (ctf_func_type_info): Just use the vlen. 281*c42dbd0eSchristos (ctf_func_type_args): Likewise. 282*c42dbd0eSchristos 283*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 284*c42dbd0eSchristos 285*c42dbd0eSchristos * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_arr>: Remove. 286*c42dbd0eSchristos * ctf-create.c (ctf_add_array): Use the dtd_vlen, not dtu_arr. 287*c42dbd0eSchristos (ctf_set_array): Likewise. 288*c42dbd0eSchristos * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen. 289*c42dbd0eSchristos * ctf-types.c (ctf_array_info): Just use the vlen. 290*c42dbd0eSchristos 291*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 292*c42dbd0eSchristos 293*c42dbd0eSchristos * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_enc>: Remove. 294*c42dbd0eSchristos <dtd_u.dtu_slice>: Likewise. 295*c42dbd0eSchristos <dtd_vlen>: New. 296*c42dbd0eSchristos * ctf-create.c (ctf_add_generic): Perhaps allocate it. All 297*c42dbd0eSchristos callers adjusted. 298*c42dbd0eSchristos (ctf_dtd_delete): Free it. 299*c42dbd0eSchristos (ctf_add_slice): Use the dtd_vlen, not dtu_enc. 300*c42dbd0eSchristos (ctf_add_encoded): Likewise. Assert that this must be an int or 301*c42dbd0eSchristos float. 302*c42dbd0eSchristos * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen. 303*c42dbd0eSchristos * ctf-dedup.c (ctf_dedup_rhash_type): Use the dtd_vlen, not 304*c42dbd0eSchristos dtu_slice. 305*c42dbd0eSchristos * ctf-types.c (ctf_type_reference): Likewise. 306*c42dbd0eSchristos (ctf_type_encoding): Remove most dynamic-type-specific code: just 307*c42dbd0eSchristos get the vlen from the right place. Report failure to look up the 308*c42dbd0eSchristos underlying type's encoding. 309*c42dbd0eSchristos 310*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 311*c42dbd0eSchristos 312*c42dbd0eSchristos * ctf-archive.c (ctf_archive_next): GNU style fix for do {} while. 313*c42dbd0eSchristos * ctf-dedup.c (ctf_dedup_rhash_type): Likewise. 314*c42dbd0eSchristos (ctf_dedup_rwalk_one_output_mapping): Likewise. 315*c42dbd0eSchristos * ctf-dump.c (ctf_dump_format_type): Likewise. 316*c42dbd0eSchristos * ctf-lookup.c (ctf_symbol_next): Likewise. 317*c42dbd0eSchristos * swap.h (swap_thing): Likewise. 318*c42dbd0eSchristos 319*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 320*c42dbd0eSchristos 321*c42dbd0eSchristos * ctf-serialize.c: General reshuffling, and... 322*c42dbd0eSchristos (emit_symtypetab_state_t): New, migrated from 323*c42dbd0eSchristos local variables in ctf_serialize. 324*c42dbd0eSchristos (ctf_serialize): Split out most section sizing and 325*c42dbd0eSchristos emission. 326*c42dbd0eSchristos (ctf_symtypetab_sect_sizes): New (split out). 327*c42dbd0eSchristos (ctf_emit_symtypetab_sects): Likewise. 328*c42dbd0eSchristos (ctf_type_sect_size): Likewise. 329*c42dbd0eSchristos (ctf_emit_type_sect): Likewise. 330*c42dbd0eSchristos 331*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 332*c42dbd0eSchristos 333*c42dbd0eSchristos * ctf-impl.h (ctf_dict_t): Fix comment. 334*c42dbd0eSchristos 335*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 336*c42dbd0eSchristos 337*c42dbd0eSchristos * ctf-create.c (symtypetab_delete_nonstatic_vars): Move 338*c42dbd0eSchristos into ctf-serialize.c. 339*c42dbd0eSchristos (ctf_symtab_skippable): Likewise. 340*c42dbd0eSchristos (CTF_SYMTYPETAB_EMIT_FUNCTION): Likewise. 341*c42dbd0eSchristos (CTF_SYMTYPETAB_EMIT_PAD): Likewise. 342*c42dbd0eSchristos (CTF_SYMTYPETAB_FORCE_INDEXED): Likewise. 343*c42dbd0eSchristos (symtypetab_density): Likewise. 344*c42dbd0eSchristos (emit_symtypetab): Likewise. 345*c42dbd0eSchristos (emit_symtypetab_index): Likewise. 346*c42dbd0eSchristos (ctf_copy_smembers): Likewise. 347*c42dbd0eSchristos (ctf_copy_lmembers): Likewise. 348*c42dbd0eSchristos (ctf_copy_emembers): Likewise. 349*c42dbd0eSchristos (ctf_sort_var): Likewise. 350*c42dbd0eSchristos (ctf_serialize): Likewise. 351*c42dbd0eSchristos (ctf_gzwrite): Likewise. 352*c42dbd0eSchristos (ctf_compress_write): Likewise. 353*c42dbd0eSchristos (ctf_write_mem): Likewise. 354*c42dbd0eSchristos (ctf_write): Likewise. 355*c42dbd0eSchristos * ctf-serialize.c: New file. 356*c42dbd0eSchristos * Makefile.am (libctf_nobfd_la_SOURCES): Add it. 357*c42dbd0eSchristos * Makefile.in: Regenerate. 358*c42dbd0eSchristos 359*c42dbd0eSchristos2021-03-18 Nick Alcock <nick.alcock@oracle.com> 360*c42dbd0eSchristos 361*c42dbd0eSchristos * ctf-link.c (ctf_link_lazy_open): Move up in the file, to near 362*c42dbd0eSchristos ctf_link_add_ctf. 363*c42dbd0eSchristos * ctf-lookup.c (ctf_lookup_symbol_idx): Repair tabdamage. 364*c42dbd0eSchristos (ctf_lookup_by_sym_or_name): Likewise. 365*c42dbd0eSchristos * testsuite/libctf-lookup/struct-iteration.c: Likewise. 366*c42dbd0eSchristos * testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise. 367*c42dbd0eSchristos 368*c42dbd0eSchristos2021-03-02 Nick Alcock <nick.alcock@oracle.com> 369*c42dbd0eSchristos 370*c42dbd0eSchristos * ctf-create.c (symtypetab_density): Report the symbol name as 371*c42dbd0eSchristos well as index in the name != object error; note the likely 372*c42dbd0eSchristos consequences. 373*c42dbd0eSchristos * ctf-link.c (ctf_link_shuffle_syms): Report the symbol index 374*c42dbd0eSchristos as well as name. 375*c42dbd0eSchristos 376*c42dbd0eSchristos2021-03-02 Nick Alcock <nick.alcock@oracle.com> 377*c42dbd0eSchristos 378*c42dbd0eSchristos * ctf-link.c (ctf_link_shuffle_syms): Free ctf_dynsyms properly. 379*c42dbd0eSchristos 380*c42dbd0eSchristos2021-03-02 Nick Alcock <nick.alcock@oracle.com> 381*c42dbd0eSchristos 382*c42dbd0eSchristos * ctf-dump.c (ctf_dump_format_type): Fix signed/unsigned confusion. 383*c42dbd0eSchristos 384*c42dbd0eSchristos2021-03-02 Nick Alcock <nick.alcock@oracle.com> 385*c42dbd0eSchristos 386*c42dbd0eSchristos * ctf-dedup.c (ctf_dedup): Pass on errors from ctf_dedup_hash_type. 387*c42dbd0eSchristos Call ctf_dedup_fini properly on other errors. 388*c42dbd0eSchristos (ctf_dedup_emit_type): Set the errno on dynhash insertion failure. 389*c42dbd0eSchristos * ctf-link.c (ctf_link_deduplicating_per_cu): Close outputs beyond 390*c42dbd0eSchristos output 0 when asserting because >1 output is found. 391*c42dbd0eSchristos (ctf_link_deduplicating): Likewise, when asserting because the 392*c42dbd0eSchristos shared output is not the same as the passed-in fp. 393*c42dbd0eSchristos 394*c42dbd0eSchristos2021-03-02 Nick Alcock <nick.alcock@oracle.com> 395*c42dbd0eSchristos 396*c42dbd0eSchristos * ctf-impl.h (ctf_dict_t) <ctf_link_type_mapping>: No longer used 397*c42dbd0eSchristos by the nondeduplicating linker. 398*c42dbd0eSchristos (ctf_add_type_mapping): Removed, now static. 399*c42dbd0eSchristos (ctf_type_mapping): Likewise. 400*c42dbd0eSchristos (ctf_dedup_type_mapping): New. 401*c42dbd0eSchristos (ctf_dedup_t) <cd_input_nums>: New. 402*c42dbd0eSchristos * ctf-dedup.c (ctf_dedup_init): Populate it. 403*c42dbd0eSchristos (ctf_dedup_fini): Free it again. Emphasise that this has to be 404*c42dbd0eSchristos the last thing called. 405*c42dbd0eSchristos (ctf_dedup): Populate it. 406*c42dbd0eSchristos (ctf_dedup_populate_type_mapping): Removed. 407*c42dbd0eSchristos (ctf_dedup_populate_type_mappings): Likewise. 408*c42dbd0eSchristos (ctf_dedup_emit): No longer call it. No longer call 409*c42dbd0eSchristos ctf_dedup_fini either. 410*c42dbd0eSchristos (ctf_dedup_type_mapping): New. 411*c42dbd0eSchristos * ctf-link.c (ctf_unnamed_cuname): New. 412*c42dbd0eSchristos (ctf_create_per_cu): Arguments must be non-null now. 413*c42dbd0eSchristos (ctf_in_member_cb_arg): Removed. 414*c42dbd0eSchristos (ctf_link): No longer populate it. No longer discard the 415*c42dbd0eSchristos mapping table. 416*c42dbd0eSchristos (ctf_link_deduplicating_one_symtypetab): Use 417*c42dbd0eSchristos ctf_dedup_type_mapping, not ctf_type_mapping. Use 418*c42dbd0eSchristos ctf_unnamed_cuname. 419*c42dbd0eSchristos (ctf_link_one_variable): Likewise. Pass in args individually: no 420*c42dbd0eSchristos longer a ctf_variable_iter callback. 421*c42dbd0eSchristos (empty_link_type_mapping): Removed. 422*c42dbd0eSchristos (ctf_link_deduplicating_variables): Use ctf_variable_next, not 423*c42dbd0eSchristos ctf_variable_iter. No longer pack arguments to 424*c42dbd0eSchristos ctf_link_one_variable into a struct. 425*c42dbd0eSchristos (ctf_link_deduplicating_per_cu): Call ctf_dedup_fini once 426*c42dbd0eSchristos all link phases are done. 427*c42dbd0eSchristos (ctf_link_deduplicating): Likewise. 428*c42dbd0eSchristos (ctf_link_intern_extern_string): Improve comment. 429*c42dbd0eSchristos (ctf_add_type_mapping): Migrate... 430*c42dbd0eSchristos (ctf_type_mapping): ... these functions... 431*c42dbd0eSchristos * ctf-create.c (ctf_add_type_mapping): ... here... 432*c42dbd0eSchristos (ctf_type_mapping): ... and make static, for the sole use of 433*c42dbd0eSchristos ctf_add_type. 434*c42dbd0eSchristos 435*c42dbd0eSchristos2021-03-02 Nick Alcock <nick.alcock@oracle.com> 436*c42dbd0eSchristos 437*c42dbd0eSchristos * ctf-link.c (ctf_link_one_variable): Remove reference to 438*c42dbd0eSchristos "unconflicted link mode". 439*c42dbd0eSchristos 440*c42dbd0eSchristos2021-03-02 Nick Alcock <nick.alcock@oracle.com> 441*c42dbd0eSchristos 442*c42dbd0eSchristos * ctf-link.c (ctf_create_per_cu): Drop FILENAME now that it is 443*c42dbd0eSchristos always identical to CUNAME. 444*c42dbd0eSchristos (ctf_link_deduplicating_one_symtypetab): Adjust. 445*c42dbd0eSchristos (ctf_link_one_type): Remove. 446*c42dbd0eSchristos (ctf_link_one_input_archive_member): Likewise. 447*c42dbd0eSchristos (ctf_link_close_one_input_archive): Likewise. 448*c42dbd0eSchristos (ctf_link_one_input_archive): Likewise. 449*c42dbd0eSchristos (ctf_link): No longer call it. Drop CTF_LINK_NONDEDUP path. 450*c42dbd0eSchristos Improve header comment a bit (dicts, not files). Adjust 451*c42dbd0eSchristos ctf_create_per_cu call. 452*c42dbd0eSchristos (ctf_link_deduplicating_variables): Simplify. 453*c42dbd0eSchristos (ctf_link_in_member_cb_arg_t) <cu_name>: Remove. 454*c42dbd0eSchristos <in_input_cu_file>: Likewise. 455*c42dbd0eSchristos <in_fp_parent>: Likewise. 456*c42dbd0eSchristos <done_parent>: Likewise. 457*c42dbd0eSchristos (ctf_link_one_variable): Turn uses of in_file_name to in_cuname. 458*c42dbd0eSchristos 459*c42dbd0eSchristos2021-03-02 Nick Alcock <nick.alcock@oracle.com> 460*c42dbd0eSchristos 461*c42dbd0eSchristos * ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope. 462*c42dbd0eSchristos (ctf_enum_iter): Reimplement in terms of ctf_enum_next. 463*c42dbd0eSchristos (ctf_type_iter): Reimplement in terms of ctf_type_next. 464*c42dbd0eSchristos (ctf_type_iter_all): Likewise. 465*c42dbd0eSchristos (ctf_variable_iter): Reimplement in terms of ctf_variable_next. 466*c42dbd0eSchristos * ctf-archive.c (ctf_archive_iter_internal): Remove. 467*c42dbd0eSchristos (ctf_archive_iter): Reimplement in terms of ctf_archive_next. 468*c42dbd0eSchristos 469*c42dbd0eSchristos2021-03-02 Nick Alcock <nick.alcock@oracle.com> 470*c42dbd0eSchristos 471*c42dbd0eSchristos * ctf-archive.c (ctf_archive_next): Set the name of parents in 472*c42dbd0eSchristos single-member archives. 473*c42dbd0eSchristos 474*c42dbd0eSchristos2021-02-26 Alan Modra <amodra@gmail.com> 475*c42dbd0eSchristos 476*c42dbd0eSchristos * Makefile.in: Regenerate. 477*c42dbd0eSchristos 478*c42dbd0eSchristos2021-02-21 Alan Modra <amodra@gmail.com> 479*c42dbd0eSchristos 480*c42dbd0eSchristos * configure.ac: Invoke AC_CANONICAL_TARGET, AC_CANONICAL_HOST 481*c42dbd0eSchristos and AC_CANONICAL_BUILD. 482*c42dbd0eSchristos * configure: Regenerate. 483*c42dbd0eSchristos * Makefile.in: Regenerate. 484*c42dbd0eSchristos 485*c42dbd0eSchristos2021-02-20 Nick Alcock <nick.alcock@oracle.com> 486*c42dbd0eSchristos 487*c42dbd0eSchristos * ctf-impl.h (ctf_dict_t) <ctf_symhash>: New. 488*c42dbd0eSchristos <ctf_symhash_latest>: Likewise. 489*c42dbd0eSchristos (struct ctf_archive_internal) <ctfi_crossdict_cache>: New. 490*c42dbd0eSchristos <ctfi_symnamedicts>: New. 491*c42dbd0eSchristos <ctfi_syms>: Remove. 492*c42dbd0eSchristos (ctf_lookup_symbol_name): Remove. 493*c42dbd0eSchristos * ctf-lookup.c (ctf_lookup_symbol_name): Propagate errors from 494*c42dbd0eSchristos parent properly. Make static. 495*c42dbd0eSchristos (ctf_lookup_symbol_idx): New, linear search for the symbol name, 496*c42dbd0eSchristos cached in the crossdict cache's ctf_symhash (if available), or 497*c42dbd0eSchristos this dict's (otherwise). 498*c42dbd0eSchristos (ctf_try_lookup_indexed): Allow the symname to be passed in. 499*c42dbd0eSchristos (ctf_lookup_by_symbol): Turn into a wrapper around... 500*c42dbd0eSchristos (ctf_lookup_by_sym_or_name): ... this, supporting name lookup too, 501*c42dbd0eSchristos using ctf_lookup_symbol_idx in non-writable dicts. Special-case 502*c42dbd0eSchristos name lookup in dynamic dicts without reported symbols, which have 503*c42dbd0eSchristos no symtab or dynsymidx but where name lookup should still work. 504*c42dbd0eSchristos (ctf_lookup_by_symbol_name): New, another wrapper. 505*c42dbd0eSchristos * ctf-archive.c (enosym): Note that this is present in 506*c42dbd0eSchristos ctfi_symnamedicts too. 507*c42dbd0eSchristos (ctf_arc_close): Adjust for removal of ctfi_syms. Free the 508*c42dbd0eSchristos ctfi_symnamedicts. 509*c42dbd0eSchristos (ctf_arc_flush_caches): Likewise. 510*c42dbd0eSchristos (ctf_dict_open_cached): Memoize the first cached dict in the 511*c42dbd0eSchristos crossdict cache. 512*c42dbd0eSchristos (ctf_arc_lookup_symbol): Turn into a wrapper around... 513*c42dbd0eSchristos (ctf_arc_lookup_sym_or_name): ... this. No longer cache 514*c42dbd0eSchristos ctf_id_t lookups: just call ctf_lookup_by_symbol as needed (but 515*c42dbd0eSchristos still cache the dicts those lookups succeed in). Add 516*c42dbd0eSchristos lookup-by-name support, with dicts of successful lookups cached in 517*c42dbd0eSchristos ctfi_symnamedicts. Refactor the caching code a bit. 518*c42dbd0eSchristos (ctf_arc_lookup_symbol_name): New, another wrapper. 519*c42dbd0eSchristos * ctf-open.c (ctf_dict_close): Free the ctf_symhash. 520*c42dbd0eSchristos * libctf.ver (LIBCTF_1.2): New version. Add 521*c42dbd0eSchristos ctf_lookup_by_symbol_name, ctf_arc_lookup_symbol_name. 522*c42dbd0eSchristos * testsuite/libctf-lookup/enum-symbol.c (main): Use 523*c42dbd0eSchristos ctf_arc_lookup_symbol rather than looking up the name ourselves. 524*c42dbd0eSchristos Fish it out repeatedly, to make sure that symbol caching isn't 525*c42dbd0eSchristos broken. 526*c42dbd0eSchristos (symidx_64): Remove. 527*c42dbd0eSchristos (symidx_32): Remove. 528*c42dbd0eSchristos * testsuite/libctf-lookup/enum-symbol-obj.lk: Test symbol lookup 529*c42dbd0eSchristos in an unlinked object file (indexed symtypetab sections only). 530*c42dbd0eSchristos * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c 531*c42dbd0eSchristos (try_maybe_reporting): Check symbol types via 532*c42dbd0eSchristos ctf_lookup_by_symbol_name as well as ctf_symbol_next. 533*c42dbd0eSchristos * testsuite/libctf-lookup/conflicting-type-syms.*: New test of 534*c42dbd0eSchristos lookups in a multi-dict archive. 535*c42dbd0eSchristos 536*c42dbd0eSchristos2021-02-20 Alan Modra <amodra@gmail.com> 537*c42dbd0eSchristos 538*c42dbd0eSchristos * testsuite/config/default.exp (ld_L_opt): Define. 539*c42dbd0eSchristos * testsuite/lib/ctf-lib.exp (load_common_lib): Delete. Instead load 540*c42dbd0eSchristos ld-lib.exp. 541*c42dbd0eSchristos (run_host_cmd, run_host_cmd_yesno, check_compiler_available): Delete. 542*c42dbd0eSchristos (compile_one_cc, check_ctf_available): Delete. 543*c42dbd0eSchristos 544*c42dbd0eSchristos2021-02-03 Nick Alcock <nick.alcock@oracle.com> 545*c42dbd0eSchristos 546*c42dbd0eSchristos * configure.ac (ac_cv_libctf_bfd_elf): Include string.h. 547*c42dbd0eSchristos * configure: Regenerated. 548*c42dbd0eSchristos 549*c42dbd0eSchristos2021-02-03 Nick Alcock <nick.alcock@oracle.com> 550*c42dbd0eSchristos 551*c42dbd0eSchristos * configure.ac (EXPECT): Check for, in order to define... 552*c42dbd0eSchristos (TCL_TRY): ... this, if Tcl supports try/catch. 553*c42dbd0eSchristos * Makefile.am (TCL_TRY): Run the testsuite only if set. 554*c42dbd0eSchristos * configure: Regenerated. 555*c42dbd0eSchristos * Makefile.in: Likewise. 556*c42dbd0eSchristos 557*c42dbd0eSchristos2021-02-02 Nick Alcock <nick.alcock@oracle.com> 558*c42dbd0eSchristos 559*c42dbd0eSchristos * configure.ac (CTF_LIBADD): Remove explicit -lintl population in 560*c42dbd0eSchristos favour of LIBINTL. 561*c42dbd0eSchristos * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly 562*c42dbd0eSchristos include $(LIBINTL). 563*c42dbd0eSchristos (check-DEJAGNU): Pass down to tests as well. 564*c42dbd0eSchristos * configure: Regenerated. 565*c42dbd0eSchristos * Makefile.in: Likewise. 566*c42dbd0eSchristos 567*c42dbd0eSchristos2021-01-27 Nick Alcock <nick.alcock@oracle.com> 568*c42dbd0eSchristos 569*c42dbd0eSchristos * ctf-string.c (ctf_str_add): Treat adding a NULL as adding "". 570*c42dbd0eSchristos (ctf_str_add_ref): Likewise. 571*c42dbd0eSchristos (ctf_str_add_external): Likewise. 572*c42dbd0eSchristos * ctf-types.c (ctf_type_name_raw): Always return "" for offset 0. 573*c42dbd0eSchristos * ctf-dedup.c (ctf_dedup_multiple_input_dicts): Don't armour 574*c42dbd0eSchristos against NULL name. 575*c42dbd0eSchristos (ctf_dedup_maybe_synthesize_forward): Likewise. 576*c42dbd0eSchristos 577*c42dbd0eSchristos2021-01-27 Nick Alcock <nick.alcock@oracle.com> 578*c42dbd0eSchristos 579*c42dbd0eSchristos * ctf-create.c (ctf_serialize): Fix shadowing. 580*c42dbd0eSchristos 581*c42dbd0eSchristos2021-01-27 Nick Alcock <nick.alcock@oracle.com> 582*c42dbd0eSchristos 583*c42dbd0eSchristos * ctf-create.c (ctf_add_encoded): Add check for non-empty name. 584*c42dbd0eSchristos (ctf_add_forward): Likewise. 585*c42dbd0eSchristos (ctf_add_typedef): Likewise. 586*c42dbd0eSchristos 587*c42dbd0eSchristos2021-01-27 Nick Alcock <nick.alcock@oracle.com> 588*c42dbd0eSchristos 589*c42dbd0eSchristos * ctf-open.c (init_types): Rip out code to check anonymous typedef 590*c42dbd0eSchristos nodes. 591*c42dbd0eSchristos * ctf-create.c (ctf_add_reftype): Likewise. 592*c42dbd0eSchristos * ctf-lookup.c (refresh_pptrtab): Likewise. 593*c42dbd0eSchristos 594*c42dbd0eSchristos2021-01-27 Nick Alcock <nick.alcock@oracle.com> 595*c42dbd0eSchristos 596*c42dbd0eSchristos * ctf-impl.c (_libctf_nonnull_): Add parameters. 597*c42dbd0eSchristos (LCTF_LINKING): New flag. 598*c42dbd0eSchristos (ctf_dict_t) <ctf_link_flags>: Mention it. 599*c42dbd0eSchristos * ctf-link.c (ctf_link): Keep LCTF_LINKING set across call. 600*c42dbd0eSchristos (ctf_write): Likewise, including in child dictionaries. 601*c42dbd0eSchristos (ctf_link_shuffle_syms): Make sure ctf_dynsyms is NULL if there 602*c42dbd0eSchristos are no reported symbols. 603*c42dbd0eSchristos * ctf-create.c (symtypetab_delete_nonstatic_vars): Make sure 604*c42dbd0eSchristos the variable has been reported as a symbol by the linker. 605*c42dbd0eSchristos (symtypetab_skippable): Mention relationship between SYMFP and the 606*c42dbd0eSchristos flags. 607*c42dbd0eSchristos (symtypetab_density): Adjust nonnullity. Exit early if no symbols 608*c42dbd0eSchristos were reported and force-indexing is off (i.e., we are doing a 609*c42dbd0eSchristos final link). 610*c42dbd0eSchristos (ctf_serialize): Handle the !LCTF_LINKING case by writing out an 611*c42dbd0eSchristos indexed, sorted symtypetab (and allow SYMFP to be NULL in this 612*c42dbd0eSchristos case). Turn sorting off if this is a non-final link. Only delete 613*c42dbd0eSchristos nonstatic vars if we are filtering symbols and the linker has 614*c42dbd0eSchristos reported some. 615*c42dbd0eSchristos * testsuite/libctf-regression/nonstatic-var-section-ld-r*: 616*c42dbd0eSchristos New test of variable and symtypetab section population when 617*c42dbd0eSchristos ld -r is used. 618*c42dbd0eSchristos * testsuite/libctf-regression/nonstatic-var-section-ld-executable.lk: 619*c42dbd0eSchristos Likewise, when ld of an executable is used. 620*c42dbd0eSchristos * testsuite/libctf-regression/nonstatic-var-section-ld.lk: 621*c42dbd0eSchristos Likewise, when ld -shared alone is used. 622*c42dbd0eSchristos * testsuite/libctf-regression/nonstatic-var-section-ld*.c: 623*c42dbd0eSchristos Lookup programs for the above. 624*c42dbd0eSchristos * testsuite/libctf-writable/symtypetab-nonlinker-writeout.*: New 625*c42dbd0eSchristos test, testing survival of symbols across ctf_write paths. 626*c42dbd0eSchristos * testsuite/lib/ctf-lib.exp (run_lookup_test): New option, 627*c42dbd0eSchristos nonshared, suppressing linking of the SOURCE with -shared. 628*c42dbd0eSchristos 629*c42dbd0eSchristos2021-01-19 Nick Alcock <nick.alcock@oracle.com> 630*c42dbd0eSchristos 631*c42dbd0eSchristos * ctf-create.c (membadd): Transform ""-named members into 632*c42dbd0eSchristos NULL-named ones. 633*c42dbd0eSchristos * testsuite/libctf-regression/type-add-unnamed-struct*: New test. 634*c42dbd0eSchristos 635*c42dbd0eSchristos2021-01-19 Nick Alcock <nick.alcock@oracle.com> 636*c42dbd0eSchristos 637*c42dbd0eSchristos * ctf-lookup.c (ctf_lookup_by_name_internal): Do not return the 638*c42dbd0eSchristos base type if looking up a nonexistent pointer type. 639*c42dbd0eSchristos * testsuite/libctf-regression/pptrtab*: Test it. 640*c42dbd0eSchristos 641*c42dbd0eSchristos2021-01-13 Alan Modra <amodra@gmail.com> 642*c42dbd0eSchristos 643*c42dbd0eSchristos * Makefile.in: Regenerate. 644*c42dbd0eSchristos 645*c42dbd0eSchristos2021-01-12 H.J. Lu <hongjiu.lu@intel.com> 646*c42dbd0eSchristos 647*c42dbd0eSchristos PR binutils/26792 648*c42dbd0eSchristos * configure.ac: Use GNU_MAKE_JOBSERVER. 649*c42dbd0eSchristos * aclocal.m4: Regenerated. 650*c42dbd0eSchristos * configure: Likewise. 651*c42dbd0eSchristos 652*c42dbd0eSchristos2021-01-11 H.J. Lu <hongjiu.lu@intel.com> 653*c42dbd0eSchristos 654*c42dbd0eSchristos PR ld/27173 655*c42dbd0eSchristos * configure: Regenerated. 656*c42dbd0eSchristos 657*c42dbd0eSchristos2021-01-09 H.J. Lu <hongjiu.lu@intel.com> 658*c42dbd0eSchristos 659*c42dbd0eSchristos * configure: Regenerated. 660*c42dbd0eSchristos 661*c42dbd0eSchristos2021-01-09 Nick Clifton <nickc@redhat.com> 662*c42dbd0eSchristos 663*c42dbd0eSchristos * 2.36 release branch crated. 664*c42dbd0eSchristos 665*c42dbd0eSchristos2021-01-09 Alan Modra <amodra@gmail.com> 666*c42dbd0eSchristos 667*c42dbd0eSchristos * configure: Regenerate. 668*c42dbd0eSchristos 669*c42dbd0eSchristos2021-01-07 Samuel Thibault <samuel.thibault@gnu.org> 670*c42dbd0eSchristos 671*c42dbd0eSchristos * configure: Regenerate. 672*c42dbd0eSchristos 673*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 674*c42dbd0eSchristos 675*c42dbd0eSchristos * testsuite/libctf-lookup/struct-iteration.c (main): 676*c42dbd0eSchristos ctf_member_count returns an int. 677*c42dbd0eSchristos 678*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 679*c42dbd0eSchristos 680*c42dbd0eSchristos * Makefile.am (BASEDIR): New. 681*c42dbd0eSchristos (BFDDIR): Likewise. 682*c42dbd0eSchristos (check-DEJAGNU): Add development.exp to prerequisites. 683*c42dbd0eSchristos (development.exp): New. 684*c42dbd0eSchristos (CONFIG_STATUS_DEPENDENCIES): New. 685*c42dbd0eSchristos (EXTRA_DEJAGNU_SITE_CONFIG): Likewise. 686*c42dbd0eSchristos (DISTCLEANFILES): Likewise. 687*c42dbd0eSchristos * Makefile.in: Regenerated. 688*c42dbd0eSchristos * testsuite/lib/ctf-lib.exp (check_ctf_available): Return boolean. 689*c42dbd0eSchristos * testsuite/libctf-lookup/lookup.exp: Call check_ctf_available. 690*c42dbd0eSchristos * testsuite/libctf-regression/regression.exp: Likewise. 691*c42dbd0eSchristos 692*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 693*c42dbd0eSchristos 694*c42dbd0eSchristos * ctf-types.c (ctf_type_aname): Print forwards to unions and enums 695*c42dbd0eSchristos properly. 696*c42dbd0eSchristos 697*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 698*c42dbd0eSchristos 699*c42dbd0eSchristos * ctf-impl.h (ctf_dict_t) <ctf_pptrtab>: New. 700*c42dbd0eSchristos <ctf_pptrtab_len>: New. 701*c42dbd0eSchristos <ctf_pptrtab_typemax>: New. 702*c42dbd0eSchristos * ctf-create.c (ctf_serialize): Update accordingly. 703*c42dbd0eSchristos (ctf_add_reftype): Note that we don't need to update pptrtab here, 704*c42dbd0eSchristos despite updating ptrtab. 705*c42dbd0eSchristos * ctf-open.c (ctf_dict_close): Destroy the pptrtab. 706*c42dbd0eSchristos (ctf_import): Likewise. 707*c42dbd0eSchristos (ctf_import_unref): Likewise. 708*c42dbd0eSchristos * ctf-lookup.c (grow_pptrtab): New. 709*c42dbd0eSchristos (refresh_pptrtab): New, update a pptrtab. 710*c42dbd0eSchristos (ctf_lookup_by_name): Turn into a wrapper around (and rename to)... 711*c42dbd0eSchristos (ctf_lookup_by_name_internal): ... this: construct the pptrtab, and 712*c42dbd0eSchristos use it in addition to the parent's ptrtab when parent dicts are 713*c42dbd0eSchristos searched. 714*c42dbd0eSchristos * testsuite/libctf-regression/regression.exp: New testsuite for 715*c42dbd0eSchristos regression tests. 716*c42dbd0eSchristos * testsuite/libctf-regression/pptrtab*: New test. 717*c42dbd0eSchristos * testsuite/libctf-writable/writable.exp: New testsuite for tests of 718*c42dbd0eSchristos writable CTF dicts. 719*c42dbd0eSchristos * testsuite/libctf-writable/pptrtab*: New test. 720*c42dbd0eSchristos 721*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 722*c42dbd0eSchristos 723*c42dbd0eSchristos * ctf-archive.c (ctf_archive_iter): Remove outdated comment. 724*c42dbd0eSchristos 725*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 726*c42dbd0eSchristos 727*c42dbd0eSchristos * ctf-impl.h (struct ctf_next) <u.ctn_next>: Move to... 728*c42dbd0eSchristos <ctn_next>: ... here. 729*c42dbd0eSchristos * ctf-util.c (ctf_next_destroy): Unconditionally destroy it. 730*c42dbd0eSchristos * ctf-lookup.c (ctf_symbol_next): Adjust accordingly. 731*c42dbd0eSchristos * ctf-types.c (ctf_member_iter): Reimplement in terms of... 732*c42dbd0eSchristos (ctf_member_next): ... this. Support recursive unnamed member 733*c42dbd0eSchristos iteration (off by default). 734*c42dbd0eSchristos (ctf_member_info): Look up members in unnamed sub-structs. 735*c42dbd0eSchristos * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_member_next call. 736*c42dbd0eSchristos (ctf_dedup_emit_struct_members): Likewise. 737*c42dbd0eSchristos * testsuite/libctf-lookup/struct-iteration-ctf.c: Test empty unnamed 738*c42dbd0eSchristos members, and a normal member after the end. 739*c42dbd0eSchristos * testsuite/libctf-lookup/struct-iteration.c: Verify that 740*c42dbd0eSchristos ctf_member_count is consistent with the number of successful returns 741*c42dbd0eSchristos from a non-recursive ctf_member_next. 742*c42dbd0eSchristos * testsuite/libctf-lookup/struct-iteration-*: New, test iteration 743*c42dbd0eSchristos over struct members. 744*c42dbd0eSchristos * testsuite/libctf-lookup/struct-lookup.c: New test. 745*c42dbd0eSchristos * testsuite/libctf-lookup/struct-lookup.lk: New test. 746*c42dbd0eSchristos 747*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 748*c42dbd0eSchristos 749*c42dbd0eSchristos * ctf-link.c (ctf_link_warn_outdated_inputs): New. 750*c42dbd0eSchristos (ctf_link_write): Call it. 751*c42dbd0eSchristos 752*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 753*c42dbd0eSchristos 754*c42dbd0eSchristos * testsuite/libctf-lookup/enum-symbol.lk: New symbol-lookup test. 755*c42dbd0eSchristos * testsuite/libctf-lookup/enum-symbol-ctf.c: New CTF input. 756*c42dbd0eSchristos * testsuite/libctf-lookup/enum-symbol.c: New lookup test. 757*c42dbd0eSchristos 758*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 759*c42dbd0eSchristos 760*c42dbd0eSchristos * Makefile.am (EXPECT): New. 761*c42dbd0eSchristos (RUNTEST): Likewise. 762*c42dbd0eSchristos (RUNTESTFLAGS): Likewise. 763*c42dbd0eSchristos (CC_FOR_TARGET): Likewise. 764*c42dbd0eSchristos (check-DEJAGNU): Likewise. 765*c42dbd0eSchristos (AUTOMAKE_OPTIONS): Add dejagnu. 766*c42dbd0eSchristos * Makefile.in: Regenerated. 767*c42dbd0eSchristos * testsuite/config/default.exp: New. 768*c42dbd0eSchristos * testsuite/lib/ctf-lib.exp: Likewise. 769*c42dbd0eSchristos * testsuite/libctf-lookup/enum.lk: New test. 770*c42dbd0eSchristos * testsuite/libctf-lookup/enum-ctf.c: New CTF input. 771*c42dbd0eSchristos * testsuite/libctf-lookup/enum.c: New lookup test. 772*c42dbd0eSchristos * testsuite/libctf-lookup/ambiguous-struct*.c: New test. 773*c42dbd0eSchristos * testsuite/libctf-lookup/lookup.exp: New. 774*c42dbd0eSchristos 775*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 776*c42dbd0eSchristos 777*c42dbd0eSchristos * configure.ac (BFD_LIBADD): Remove. 778*c42dbd0eSchristos (BFD_DEPENDENCIES): Likewise. Remove associated cases. 779*c42dbd0eSchristos (SHARED_LIBADD): Rename to... 780*c42dbd0eSchristos (CTF_LIBADD): ... this. Stick in a suitable libiberty even when 781*c42dbd0eSchristos linking statically. 782*c42dbd0eSchristos * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly. 783*c42dbd0eSchristos libctf uses libintl. 784*c42dbd0eSchristos (libctf_la_LIBADD): Reference libbfd.la directly, not via 785*c42dbd0eSchristos BFD_LIBADD. 786*c42dbd0eSchristos (libctf_la_DEPENDENCIES): Remove. 787*c42dbd0eSchristos * Makefile.in: Regenerate. 788*c42dbd0eSchristos * configure: Likewise. 789*c42dbd0eSchristos 790*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 791*c42dbd0eSchristos 792*c42dbd0eSchristos * ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack. 793*c42dbd0eSchristos * ctf-types.c (ctf_type_aname): No longer deal with slices here. 794*c42dbd0eSchristos * ctf-dump.c (ctf_dump_membstate_t) <cdm_toplevel_indent>: Constify. 795*c42dbd0eSchristos (CTF_FT_REFS): New. 796*c42dbd0eSchristos (CTF_FT_BITFIELD): Likewise. 797*c42dbd0eSchristos (CTF_FT_ID): Likewise. 798*c42dbd0eSchristos (ctf_dump_member): Do not do indentation here. Migrate the 799*c42dbd0eSchristos type-printing parts of this into... 800*c42dbd0eSchristos (ctf_dump_format_type): ... here, to be shared by all type printers. 801*c42dbd0eSchristos Get the errno value for non-representable types right. Do not print 802*c42dbd0eSchristos bitfield info for non-bitfields. Improve the format and indentation 803*c42dbd0eSchristos of other type output. Shuffle spacing around to make all indentation 804*c42dbd0eSchristos either 'width of column' or 4 chars. 805*c42dbd0eSchristos (ctf_dump_label): Pass CTF_FT_REFS to ctf_dump_format_type. 806*c42dbd0eSchristos (ctf_dump_objts): Likewise. Spacing shuffle. 807*c42dbd0eSchristos (ctf_dump_var): Likewise. 808*c42dbd0eSchristos (type_hex_digits): Migrate down in the file, to above its new user. 809*c42dbd0eSchristos (ctf_dump_type): Indent here instead. Pass CTF_FT_REFS to 810*c42dbd0eSchristos ctf_dump_format_type. Don't trim off excess linefeeds now we no 811*c42dbd0eSchristos longer generate them. Dump enumerated types. 812*c42dbd0eSchristos 813*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 814*c42dbd0eSchristos 815*c42dbd0eSchristos * ctf-types.c (ctf_type_resolve): Improve comment. 816*c42dbd0eSchristos (ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards. 817*c42dbd0eSchristos Emit errors into the right dict. 818*c42dbd0eSchristos (ctf_type_align): Likewise. 819*c42dbd0eSchristos * ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE 820*c42dbd0eSchristos when adding a member without explicit offset when this member, or 821*c42dbd0eSchristos the previous member, is incomplete. 822*c42dbd0eSchristos * ctf-dump.c (ctf_dump_format_type): Do not try to print the size of 823*c42dbd0eSchristos forwards. 824*c42dbd0eSchristos (ctf_dump_member): Do not try to print their alignment. 825*c42dbd0eSchristos 826*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 827*c42dbd0eSchristos 828*c42dbd0eSchristos * ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type. 829*c42dbd0eSchristos (ctf_dump_format_type): Don't emit the size for function objects. 830*c42dbd0eSchristos Dump the element type of arrays like we dump the pointed-to type of 831*c42dbd0eSchristos pointers, etc. 832*c42dbd0eSchristos 833*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 834*c42dbd0eSchristos 835*c42dbd0eSchristos * ctf-dump.c (ctf_dump_format_type): Add 0x to hex type IDs. 836*c42dbd0eSchristos (ctf_dump_header): Add 0x to the hex magic number. 837*c42dbd0eSchristos (ctf_dump_str): Add 0x to the hex string offsets. 838*c42dbd0eSchristos (ctf_dump_membstate_t) <cdm_toplevel_indent>: New. 839*c42dbd0eSchristos (ctf_dump_type): Adjust. Free it when we're done. 840*c42dbd0eSchristos (type_hex_digits): New. 841*c42dbd0eSchristos (ctf_dump_member): Align output depending on the width of the type 842*c42dbd0eSchristos ID being generated. Use printf padding, not a loop, to generate 843*c42dbd0eSchristos indentation. 844*c42dbd0eSchristos 845*c42dbd0eSchristos2021-01-05 Nick Alcock <nick.alcock@oracle.com> 846*c42dbd0eSchristos 847*c42dbd0eSchristos * ctf-decl.c (ctf_decl_push): Don't print array decls backwards. 848*c42dbd0eSchristos 849*c42dbd0eSchristos2021-01-04 Nicolas Boulenguez <nicolas@debian.org> 850*c42dbd0eSchristos 851*c42dbd0eSchristos PR 27117 852*c42dbd0eSchristos * configure.ac: Make AC_CONFIG_MACRO_DIR consistent with 853*c42dbd0eSchristos ACLOCAL_AMFLAGS -I dirs. 854*c42dbd0eSchristos * configure: Regenerate. 855*c42dbd0eSchristos 856*c42dbd0eSchristos2021-01-01 Alan Modra <amodra@gmail.com> 857867d70fcSchristos 858867d70fcSchristos Update year range in copyright notice of all files. 859867d70fcSchristos 860*c42dbd0eSchristosFor older changes see ChangeLog-2020 861867d70fcSchristos 862*c42dbd0eSchristosCopyright (C) 2021-2022 Free Software Foundation, Inc. 863*c42dbd0eSchristos 864*c42dbd0eSchristosCopying and distribution of this file, with or without modification, 865*c42dbd0eSchristosare permitted in any medium without royalty provided the copyright 866*c42dbd0eSchristosnotice and this notice are preserved. 867*c42dbd0eSchristos 868867d70fcSchristosLocal Variables: 869867d70fcSchristosmode: change-log 870867d70fcSchristosleft-margin: 8 871*c42dbd0eSchristosfill-column: 74 872867d70fcSchristosversion-control: never 873867d70fcSchristosEnd: 874