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.1 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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_hex_chars;
  20. json_parse_double;
  21. json_parse_int64;
  22. json_parse_uint64;
  23. lh_table_delete;
  24. lh_table_delete_entry;
  25. lh_table_free;
  26. lh_table_insert;
  27. lh_table_insert_w_hash;
  28. lh_table_new;
  29. lh_table_resize;
  30. mc_debug;
  31. mc_error;
  32. mc_get_debug;
  33. mc_info;
  34. mc_set_debug;
  35. mc_set_syslog;
  36. printbuf_free;
  37. printbuf_memappend;
  38. printbuf_memset;
  39. printbuf_new;
  40. printbuf_reset;
  41. sprintbuf;
  42. };
  43. JSONC_0.14 {
  44. global:
  45. array_list_bsearch;
  46. array_list_get_idx;
  47. array_list_length;
  48. json_c_get_random_seed;
  49. json_c_object_sizeof;
  50. json_c_set_serialization_double_format;
  51. json_c_shallow_copy_default;
  52. json_c_version;
  53. json_c_version_num;
  54. json_c_visit;
  55. json_global_set_string_hash;
  56. json_number_chars;
  57. json_object_array_add;
  58. json_object_array_bsearch;
  59. json_object_array_del_idx;
  60. json_object_array_get_idx;
  61. json_object_array_length;
  62. json_object_array_put_idx;
  63. json_object_array_sort;
  64. json_object_deep_copy;
  65. json_object_double_to_json_string;
  66. json_object_equal;
  67. json_object_free_userdata;
  68. json_object_from_fd;
  69. json_object_from_fd_ex;
  70. json_object_from_file;
  71. json_object_get;
  72. json_object_get_array;
  73. json_object_get_boolean;
  74. json_object_get_double;
  75. json_object_get_int64;
  76. json_object_get_int;
  77. json_object_get_object;
  78. json_object_get_string;
  79. json_object_get_string_len;
  80. json_object_get_type;
  81. json_object_get_uint64;
  82. json_object_get_userdata;
  83. json_object_int_inc;
  84. json_object_is_type;
  85. json_object_iter_begin;
  86. json_object_iter_end;
  87. json_object_iter_equal;
  88. json_object_iter_init_default;
  89. json_object_iter_next;
  90. json_object_iter_peek_name;
  91. json_object_iter_peek_value;
  92. json_object_new_array;
  93. json_object_new_boolean;
  94. json_object_new_double;
  95. json_object_new_double_s;
  96. json_object_new_int64;
  97. json_object_new_int;
  98. json_object_new_null;
  99. json_object_new_object;
  100. json_object_new_string;
  101. json_object_new_string_len;
  102. json_object_new_uint64;
  103. json_object_object_add;
  104. json_object_object_add_ex;
  105. json_object_object_del;
  106. json_object_object_get;
  107. json_object_object_get_ex;
  108. json_object_object_length;
  109. json_object_put;
  110. json_object_set_boolean;
  111. json_object_set_double;
  112. json_object_set_int64;
  113. json_object_set_int;
  114. json_object_set_serializer;
  115. json_object_set_string;
  116. json_object_set_string_len;
  117. json_object_set_uint64;
  118. json_object_set_userdata;
  119. json_object_to_fd;
  120. json_object_to_file;
  121. json_object_to_file_ext;
  122. json_object_to_json_string;
  123. json_object_to_json_string_ext;
  124. json_object_to_json_string_length;
  125. json_object_userdata_to_json_string;
  126. json_pointer_get;
  127. json_pointer_getf;
  128. json_pointer_set;
  129. json_pointer_setf;
  130. json_tokener_error_desc;
  131. json_tokener_free;
  132. json_tokener_get_error;
  133. json_tokener_get_parse_end;
  134. json_tokener_new;
  135. json_tokener_new_ex;
  136. json_tokener_parse;
  137. json_tokener_parse_ex;
  138. json_tokener_parse_verbose;
  139. json_tokener_reset;
  140. json_tokener_set_flags;
  141. json_type_to_name;
  142. json_util_get_last_err;
  143. lh_char_equal;
  144. lh_kchar_table_new;
  145. lh_kptr_table_new;
  146. lh_ptr_equal;
  147. lh_table_length;
  148. lh_table_lookup_entry;
  149. lh_table_lookup_entry_w_hash;
  150. lh_table_lookup_ex;
  151. local:
  152. *;
  153. };
  154. JSONC_0.15 {
  155. global:
  156. array_list_new2;
  157. array_list_shrink;
  158. json_object_array_shrink;
  159. json_object_new_array_ext;
  160. } JSONC_0.14;
  161. JSONC_0.16 {
  162. # global:
  163. # ...new symbols here...
  164. } JSONC_0.15;