|
21 | 21 | * ./gendwarfksyms --stable --dump-dies \
|
22 | 22 | * examples/kabi_ex.o 2>&1 >/dev/null | \
|
23 | 23 | * FileCheck examples/kabi_ex.h --check-prefix=STABLE
|
| 24 | +
|
| 25 | + * $ nm examples/kabi_ex.o | awk '{ print $NF }' | \ |
| 26 | + * ./gendwarfksyms --stable --dump-versions \ |
| 27 | + * examples/kabi_ex.o 2>&1 >/dev/null | \ |
| 28 | + * sort | \ |
| 29 | + * FileCheck examples/kabi_ex.h --check-prefix=VERSIONS |
24 | 30 | */
|
25 | 31 |
|
26 | 32 | #ifndef __KABI_EX_H__
|
@@ -170,7 +176,7 @@ struct ex2a {
|
170 | 176 | /*
|
171 | 177 | * STABLE: variable structure_type ex2a {
|
172 | 178 | * STABLE-NEXT: member base_type int byte_size(4) encoding(5) a data_member_location(0) ,
|
173 |
| - * STABLE-NEXT: member base_type [[ULONG:long unsigned int|unsigned long]] byte_size(8) encoding(7) b data_member_location(8) |
| 179 | + * STABLE-NEXT: member base_type [[ULONG]] byte_size(8) encoding(7) b data_member_location(8) |
174 | 180 | * STABLE-NEXT: member base_type int byte_size(4) encoding(5) c data_member_location(16) ,
|
175 | 181 | * STABLE-NEXT: member base_type [[ULONG]] byte_size(8) encoding(7) d data_member_location(24)
|
176 | 182 | * STABLE-NEXT: } byte_size(32)
|
@@ -227,7 +233,7 @@ struct ex3a {
|
227 | 233 |
|
228 | 234 | /*
|
229 | 235 | * STABLE: variable structure_type ex3a {
|
230 |
| - * STABLE-NEXT: member base_type [[ULONG:long unsigned int|unsigned long]] byte_size(8) encoding(7) a data_member_location(0) |
| 236 | + * STABLE-NEXT: member base_type [[ULONG]] byte_size(8) encoding(7) a data_member_location(0) |
231 | 237 | * STABLE-NEXT: member base_type [[ULONG]] byte_size(8) encoding(7) unused data_member_location(8)
|
232 | 238 | * STABLE-NEXT: } byte_size(16)
|
233 | 239 | */
|
@@ -282,4 +288,73 @@ KABI_BYTE_SIZE(ex4a, 8);
|
282 | 288 | * STABLE-NEXT: } byte_size(8)
|
283 | 289 | */
|
284 | 290 |
|
| 291 | +/* |
| 292 | + * Example: A type string override. |
| 293 | + */ |
| 294 | + |
| 295 | +struct ex5a { |
| 296 | + unsigned long a; |
| 297 | +}; |
| 298 | + |
| 299 | +/* |
| 300 | + * This may be safe if the structure is fully opaque to modules, even though |
| 301 | + * its definition has inadvertently become part of the ABI. |
| 302 | + */ |
| 303 | +KABI_TYPE_STRING( |
| 304 | + "s#ex5a", |
| 305 | + "structure_type ex5a { member pointer_type { s#ex4a } byte_size(8) p data_member_location(0) } byte_size(8)"); |
| 306 | + |
| 307 | +/* |
| 308 | + * Make sure the fully expanded type string includes ex4a. |
| 309 | + * |
| 310 | + * VERSIONS: ex5a variable structure_type ex5a { |
| 311 | + * VERSIONS-SAME: member pointer_type { |
| 312 | + * VERSIONS-SAME: structure_type ex4a { |
| 313 | + * VERSIONS-SAME: member base_type [[ULONG:long unsigned int|unsigned long]] byte_size(8) encoding(7) a data_member_location(0) |
| 314 | + * VERSIONS-SAME: } byte_size(8) |
| 315 | + * VERSIONS-SAME: } byte_size(8) p data_member_location(0) |
| 316 | + * VERSIONS-SAME: } byte_size(8) |
| 317 | + */ |
| 318 | + |
| 319 | +/* |
| 320 | + * Example: A type string definition for a non-existent type. |
| 321 | + */ |
| 322 | + |
| 323 | +struct ex5b { |
| 324 | + unsigned long a; |
| 325 | +}; |
| 326 | + |
| 327 | +/* Replace the type string for struct ex5b */ |
| 328 | +KABI_TYPE_STRING( |
| 329 | + "s#ex5b", |
| 330 | + "structure_type ex5b { member pointer_type { s#ex5c } byte_size(8) p data_member_location(0) } byte_size(8)"); |
| 331 | + |
| 332 | +/* Define a type string for a non-existent struct ex5c */ |
| 333 | +KABI_TYPE_STRING( |
| 334 | + "s#ex5c", |
| 335 | + "structure_type ex5c { member base_type int byte_size(4) encoding(5) n data_member_location(0) } byte_size(8)"); |
| 336 | + |
| 337 | +/* |
| 338 | + * Make sure the fully expanded type string includes the definition for ex5c. |
| 339 | + * |
| 340 | + * VERSIONS: ex5b variable structure_type ex5b { |
| 341 | + * VERSIONS-SAME: member pointer_type { |
| 342 | + * VERSIONS-SAME: structure_type ex5c { |
| 343 | + * VERSIONS-SAME: member base_type int byte_size(4) encoding(5) n data_member_location(0) |
| 344 | + * VERSIONS-SAME: } byte_size(8) |
| 345 | + * VERSIONS-SAME: } byte_size(8) p data_member_location(0) |
| 346 | + * VERSIONS-SAME: } byte_size(8) |
| 347 | + */ |
| 348 | + |
| 349 | +/* |
| 350 | + * Example: A type string override for a symbol. |
| 351 | + */ |
| 352 | + |
| 353 | +KABI_TYPE_STRING("ex6a", "variable s#ex5c"); |
| 354 | + |
| 355 | +/* |
| 356 | + * VERSIONS: ex6a variable structure_type ex5c { |
| 357 | + * VERSIONS-SAME: member base_type int byte_size(4) encoding(5) n data_member_location(0) |
| 358 | + * VERSIONS-SAME: } byte_size(8) |
| 359 | + */ |
285 | 360 | #endif /* __KABI_EX_H__ */
|
0 commit comments