You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

json-c.sym 4.3 kB

build: Add symbol versions to all exported symbols With this version script, newly-linked binaries that depend on the json-c shared library will refer to its symbols in a versioned form, preventing their references from being resolved to a symbol of the same name exported by json-glib or libjansson if those libraries appear in dependency search order before json-c, which will usually result in a crash. This is necessary because ELF symbol resolution normally uses a single flat namespace, not a tree like Windows symbol resolution. At least one symbol (json_object_iter_next()) is exported by all three JSON libraries. Linking with -Bsymbolic is not enough to have this effect in all cases, because -Bsymbolic only affects symbol lookup within a shared object, for example when json_object_set_serializer() calls json_object_set_userdata(). It does not affect calls from external code into json-c, unless json-c was statically linked into the external caller. This change will also not prevent code that depends on json-glib or libjansson from finding json-c's symbols and crashing; to prevent that, a corresponding change in json-glib or libjansson would be needed. Adding a symbol-version is a backwards-compatible change, but once added, removing or changing the symbol-version on a symbol would be an incompatible change that requires a SONAME bump. Resolves: https://github.com/json-c/json-c/issues/621 (when combined with an equivalent change to libjansson). Signed-off-by: Simon McVittie <smcv@collabora.com>
5 years ago
build: Add symbol versions to all exported symbols With this version script, newly-linked binaries that depend on the json-c shared library will refer to its symbols in a versioned form, preventing their references from being resolved to a symbol of the same name exported by json-glib or libjansson if those libraries appear in dependency search order before json-c, which will usually result in a crash. This is necessary because ELF symbol resolution normally uses a single flat namespace, not a tree like Windows symbol resolution. At least one symbol (json_object_iter_next()) is exported by all three JSON libraries. Linking with -Bsymbolic is not enough to have this effect in all cases, because -Bsymbolic only affects symbol lookup within a shared object, for example when json_object_set_serializer() calls json_object_set_userdata(). It does not affect calls from external code into json-c, unless json-c was statically linked into the external caller. This change will also not prevent code that depends on json-glib or libjansson from finding json-c's symbols and crashing; to prevent that, a corresponding change in json-glib or libjansson would be needed. Adding a symbol-version is a backwards-compatible change, but once added, removing or changing the symbol-version on a symbol would be an incompatible change that requires a SONAME bump. Resolves: https://github.com/json-c/json-c/issues/621 (when combined with an equivalent change to libjansson). Signed-off-by: Simon McVittie <smcv@collabora.com>
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. /*
  2. * Symbol versioning for libjson-c.
  3. * All exported symbols must be listed here.
  4. *
  5. * See
  6. * https://software.intel.com/sites/default/files/m/a/1/e/dsohowto.pdf
  7. */
  8. /*
  9. * Symbols in JSONC_PRIVATE are exported for historical
  10. * reasons, but should not be used outside of json-c.
  11. */
  12. JSONC_PRIVATE {
  13. array_list_add;
  14. array_list_del_idx;
  15. array_list_free;
  16. array_list_new;
  17. array_list_put_idx;
  18. array_list_sort;
  19. json_pointer_get_internal;
  20. json_hex_chars;
  21. json_parse_double;
  22. json_parse_int64;
  23. json_parse_uint64;
  24. lh_table_delete;
  25. lh_table_delete_entry;
  26. lh_table_free;
  27. lh_table_insert;
  28. lh_table_insert_w_hash;
  29. lh_table_new;
  30. lh_table_resize;
  31. mc_debug;
  32. mc_error;
  33. mc_get_debug;
  34. mc_info;
  35. mc_set_debug;
  36. mc_set_syslog;
  37. printbuf_free;
  38. printbuf_memappend;
  39. printbuf_memset;
  40. printbuf_new;
  41. printbuf_reset;
  42. sprintbuf;
  43. # Used by tests:
  44. _json_c_strerror;
  45. };
  46. JSONC_0.14 {
  47. global:
  48. array_list_bsearch;
  49. array_list_get_idx;
  50. array_list_length;
  51. json_c_get_random_seed;
  52. json_c_object_sizeof;
  53. json_c_set_serialization_double_format;
  54. json_c_shallow_copy_default;
  55. json_c_version;
  56. json_c_version_num;
  57. json_c_visit;
  58. json_global_set_string_hash;
  59. json_number_chars;
  60. json_object_array_add;
  61. json_object_array_bsearch;
  62. json_object_array_del_idx;
  63. json_object_array_get_idx;
  64. json_object_array_length;
  65. json_object_array_put_idx;
  66. json_object_array_sort;
  67. json_object_deep_copy;
  68. json_object_double_to_json_string;
  69. json_object_equal;
  70. json_object_free_userdata;
  71. json_object_from_fd;
  72. json_object_from_fd_ex;
  73. json_object_from_file;
  74. json_object_get;
  75. json_object_get_array;
  76. json_object_get_boolean;
  77. json_object_get_double;
  78. json_object_get_int64;
  79. json_object_get_int;
  80. json_object_get_object;
  81. json_object_get_string;
  82. json_object_get_string_len;
  83. json_object_get_type;
  84. json_object_get_uint64;
  85. json_object_get_userdata;
  86. json_object_int_inc;
  87. json_object_is_type;
  88. json_object_iter_begin;
  89. json_object_iter_end;
  90. json_object_iter_equal;
  91. json_object_iter_init_default;
  92. json_object_iter_next;
  93. json_object_iter_peek_name;
  94. json_object_iter_peek_value;
  95. json_object_new_array;
  96. json_object_new_boolean;
  97. json_object_new_double;
  98. json_object_new_double_s;
  99. json_object_new_int64;
  100. json_object_new_int;
  101. json_object_new_null;
  102. json_object_new_object;
  103. json_object_new_string;
  104. json_object_new_string_len;
  105. json_object_new_uint64;
  106. json_object_object_add;
  107. json_object_object_add_ex;
  108. json_object_object_del;
  109. json_object_object_get;
  110. json_object_object_get_ex;
  111. json_object_object_length;
  112. json_object_put;
  113. json_object_set_boolean;
  114. json_object_set_double;
  115. json_object_set_int64;
  116. json_object_set_int;
  117. json_object_set_serializer;
  118. json_object_set_string;
  119. json_object_set_string_len;
  120. json_object_set_uint64;
  121. json_object_set_userdata;
  122. json_object_to_fd;
  123. json_object_to_file;
  124. json_object_to_file_ext;
  125. json_object_to_json_string;
  126. json_object_to_json_string_ext;
  127. json_object_to_json_string_length;
  128. json_object_userdata_to_json_string;
  129. json_pointer_get;
  130. json_pointer_getf;
  131. json_pointer_set;
  132. json_pointer_setf;
  133. json_tokener_error_desc;
  134. json_tokener_free;
  135. json_tokener_get_error;
  136. json_tokener_get_parse_end;
  137. json_tokener_new;
  138. json_tokener_new_ex;
  139. json_tokener_parse;
  140. json_tokener_parse_ex;
  141. json_tokener_parse_verbose;
  142. json_tokener_reset;
  143. json_tokener_set_flags;
  144. json_type_to_name;
  145. json_util_get_last_err;
  146. lh_char_equal;
  147. lh_kchar_table_new;
  148. lh_kptr_table_new;
  149. lh_ptr_equal;
  150. lh_table_length;
  151. lh_table_lookup_entry;
  152. lh_table_lookup_entry_w_hash;
  153. lh_table_lookup_ex;
  154. local:
  155. *;
  156. };
  157. JSONC_0.15 {
  158. global:
  159. array_list_new2;
  160. array_list_shrink;
  161. json_object_array_shrink;
  162. json_object_new_array_ext;
  163. } JSONC_0.14;
  164. JSONC_0.16 {
  165. global:
  166. json_object_array_insert_idx;
  167. json_patch_apply;
  168. } JSONC_0.15;
  169. JSONC_0.17 {
  170. # global:
  171. # ...new symbols here...
  172. } JSONC_0.16;