Changeset 97696ab in mainline
- Timestamp:
- 2016-05-19T18:46:03Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2112a79
- Parents:
- 9c07c3d
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/dltest/dltest.c
r9c07c3d r97696ab 96 96 { 97 97 int (*p_dl_get_private_var)(void); 98 int *(*p_dl_get_private_var_addr)(void); 98 99 int val; 99 100 … … 106 107 } 107 108 109 p_dl_get_private_var_addr = dlsym(handle, "dl_get_private_var_addr"); 110 if (p_dl_get_private_var_addr == NULL) { 111 printf("FAILED\n"); 112 return false; 113 } 114 108 115 val = p_dl_get_private_var(); 109 116 110 117 printf("Got %d, expected %d... ", val, dl_private_var_val); 111 118 if (val != dl_private_var_val) { 119 printf("dl_get_private_var_addr -> %p\n", 120 p_dl_get_private_var_addr()); 112 121 printf("FAILED\n"); 113 122 return false; … … 124 133 { 125 134 int (*p_dl_get_private_uvar)(void); 135 int *(*p_dl_get_private_uvar_addr)(void); 126 136 int val; 127 137 … … 134 144 } 135 145 146 p_dl_get_private_uvar_addr = dlsym(handle, "dl_get_private_uvar_addr"); 147 if (p_dl_get_private_uvar_addr == NULL) { 148 printf("FAILED\n"); 149 return false; 150 } 151 136 152 val = p_dl_get_private_uvar(); 137 153 138 154 printf("Got %d, expected %d... ", val, 0); 139 155 if (val != 0) { 156 printf("dl_get_private_uvar_addr -> %p\n", 157 p_dl_get_private_uvar_addr()); 140 158 printf("FAILED\n"); 141 159 return false; … … 152 170 { 153 171 int (*p_dl_get_public_var)(void); 172 int *(*p_dl_get_public_var_addr)(void); 154 173 int val; 155 174 … … 162 181 } 163 182 183 p_dl_get_public_var_addr = dlsym(handle, "dl_get_public_var_addr"); 184 if (p_dl_get_public_var_addr == NULL) { 185 printf("FAILED\n"); 186 return false; 187 } 188 164 189 val = p_dl_get_public_var(); 165 190 166 191 printf("Got %d, expected %d... ", val, dl_public_var_val); 167 192 if (val != dl_public_var_val) { 193 printf("dl_get_public_var_addr -> %p\n", 194 p_dl_get_public_var_addr()); 168 195 printf("FAILED\n"); 169 196 return false; … … 180 207 { 181 208 int (*p_dl_get_public_uvar)(void); 209 int *(*p_dl_get_public_uvar_addr)(void); 182 210 int val; 183 211 … … 190 218 } 191 219 220 p_dl_get_public_uvar_addr = dlsym(handle, "dl_get_public_uvar_addr"); 221 if (p_dl_get_public_uvar_addr == NULL) { 222 printf("FAILED\n"); 223 return false; 224 } 225 192 226 val = p_dl_get_public_uvar(); 193 227 194 228 printf("Got %d, expected %d... ", val, 0); 195 229 if (val != 0) { 230 printf("dl_get_public_uvar_addr -> %p\n", 231 p_dl_get_public_uvar_addr()); 196 232 printf("FAILED\n"); 197 233 return false; … … 208 244 { 209 245 int *p_dl_public_var; 246 int *(*p_dl_get_public_var_addr)(void); 210 247 int val; 211 248 … … 218 255 } 219 256 257 p_dl_get_public_var_addr = dlsym(handle, "dl_get_public_var_addr"); 258 if (p_dl_get_public_var_addr == NULL) { 259 printf("FAILED\n"); 260 return false; 261 } 262 220 263 val = *p_dl_public_var; 221 264 222 265 printf("Got %d, expected %d... ", val, dl_public_var_val); 223 266 if (val != dl_public_var_val) { 267 printf("&dl_public_var = %p, " 268 "dl_get_public_var_addr -> %p\n", 269 p_dl_public_var, p_dl_get_public_var_addr()); 224 270 printf("FAILED\n"); 225 271 return false; … … 236 282 { 237 283 int *p_dl_public_uvar; 284 int *(*p_dl_get_public_uvar_addr)(void); 238 285 int val; 239 286 … … 246 293 } 247 294 295 p_dl_get_public_uvar_addr = dlsym(handle, "dl_get_public_uvar_addr"); 296 if (p_dl_get_public_uvar_addr == NULL) { 297 printf("FAILED\n"); 298 return false; 299 } 300 248 301 val = *p_dl_public_uvar; 249 302 250 303 printf("Got %d, expected %d... ", val, 0); 251 304 if (val != 0) { 305 printf("&dl_public_uvar = %p, " 306 "dl_get_public_uvar_addr -> %p\n", 307 p_dl_public_uvar, p_dl_get_public_uvar_addr()); 252 308 printf("FAILED\n"); 253 309 return false; … … 264 320 { 265 321 int (*p_dl_get_private_fib_var)(void); 322 int *(*p_dl_get_private_fib_var_addr)(void); 266 323 int val; 267 324 … … 274 331 } 275 332 333 p_dl_get_private_fib_var_addr = dlsym(handle, "dl_get_private_fib_var_addr"); 334 if (p_dl_get_private_fib_var_addr == NULL) { 335 printf("FAILED\n"); 336 return false; 337 } 338 276 339 val = p_dl_get_private_fib_var(); 277 340 278 341 printf("Got %d, expected %d... ", val, dl_private_fib_var_val); 279 342 if (val != dl_private_fib_var_val) { 343 printf("dl_get_private_fib_var_addr -> %p\n", 344 p_dl_get_private_fib_var_addr()); 280 345 printf("FAILED\n"); 281 346 return false; … … 292 357 { 293 358 int (*p_dl_get_private_fib_uvar)(void); 359 int *(*p_dl_get_private_fib_uvar_addr)(void); 294 360 int val; 295 361 … … 302 368 } 303 369 370 p_dl_get_private_fib_uvar_addr = dlsym(handle, "dl_get_private_fib_uvar_addr"); 371 if (p_dl_get_private_fib_uvar_addr == NULL) { 372 printf("FAILED\n"); 373 return false; 374 } 375 304 376 val = p_dl_get_private_fib_uvar(); 305 377 306 378 printf("Got %d, expected %d... ", val, 0); 307 379 if (val != 0) { 380 printf("dl_get_private_fib_uvar_addr -> %p\n", 381 p_dl_get_private_fib_uvar_addr()); 308 382 printf("FAILED\n"); 309 383 return false; … … 320 394 { 321 395 int (*p_dl_get_public_fib_var)(void); 396 int *(*p_dl_get_public_fib_var_addr)(void); 322 397 int val; 323 398 … … 330 405 } 331 406 407 p_dl_get_public_fib_var_addr = dlsym(handle, "dl_get_public_fib_var_addr"); 408 if (p_dl_get_public_fib_var_addr == NULL) { 409 printf("FAILED\n"); 410 return false; 411 } 412 332 413 val = p_dl_get_public_fib_var(); 333 414 334 415 printf("Got %d, expected %d... ", val, dl_public_fib_var_val); 335 416 if (val != dl_public_fib_var_val) { 417 printf("dl_get_public_fib_var_addr -> %p\n", 418 p_dl_get_public_fib_var_addr()); 336 419 printf("FAILED\n"); 337 420 return false; … … 348 431 { 349 432 int (*p_dl_get_public_fib_uvar)(void); 433 int *(*p_dl_get_public_fib_uvar_addr)(void); 350 434 int val; 351 435 … … 358 442 } 359 443 444 p_dl_get_public_fib_uvar_addr = dlsym(handle, "dl_get_public_fib_uvar_addr"); 445 if (p_dl_get_public_fib_uvar_addr == NULL) { 446 printf("FAILED\n"); 447 return false; 448 } 449 360 450 val = p_dl_get_public_fib_uvar(); 361 451 362 452 printf("Got %d, expected %d... ", val, 0); 363 453 if (val != 0) { 454 printf("dl_get_public_fib_uvar_addr -> %p\n", 455 p_dl_get_public_fib_uvar_addr()); 364 456 printf("FAILED\n"); 365 457 return false; … … 376 468 { 377 469 int *p_dl_public_fib_var; 470 int *(*p_dl_get_public_fib_var_addr)(void); 378 471 int val; 379 472 … … 386 479 } 387 480 481 p_dl_get_public_fib_var_addr = dlsym(handle, "dl_get_public_fib_var_addr"); 482 if (p_dl_get_public_fib_var_addr == NULL) { 483 printf("FAILED\n"); 484 return false; 485 } 486 388 487 val = *p_dl_public_fib_var; 389 488 390 489 printf("Got %d, expected %d... ", val, dl_public_fib_var_val); 391 490 if (val != dl_public_fib_var_val) { 491 printf("&dl_public_fib_var = %p, " 492 "dl_get_public_fib_var_addr -> %p\n", 493 p_dl_public_fib_var, p_dl_get_public_fib_var_addr()); 392 494 printf("FAILED\n"); 393 495 return false; … … 404 506 { 405 507 int *p_dl_public_fib_uvar; 508 int *(*p_dl_get_public_fib_uvar_addr)(void); 406 509 int val; 407 510 … … 414 517 } 415 518 519 p_dl_get_public_fib_uvar_addr = dlsym(handle, "dl_get_public_fib_uvar_addr"); 520 if (p_dl_get_public_fib_uvar_addr == NULL) { 521 printf("FAILED\n"); 522 return false; 523 } 524 416 525 val = *p_dl_public_fib_uvar; 417 526 418 527 printf("Got %d, expected %d... ", val, 0); 419 528 if (val != 0) { 529 printf("&dl_public_fib_uvar = %p, " 530 "dl_get_public_fib_uvar_addr -> %p\n", 531 p_dl_public_fib_uvar, p_dl_get_public_fib_uvar_addr()); 420 532 printf("FAILED\n"); 421 533 return false; … … 460 572 printf("Got %d, expected %d... ", val, dl_private_var_val); 461 573 if (val != dl_private_var_val) { 574 printf("dl_get_private_var_addr -> %p\n", 575 dl_get_private_var_addr()); 462 576 printf("FAILED\n"); 463 577 return false; … … 481 595 printf("Got %d, expected %d... ", val, 0); 482 596 if (val != 0) { 597 printf("dl_get_private_uvar_addr -> %p\n", 598 dl_get_private_uvar_addr()); 483 599 printf("FAILED\n"); 484 600 return false; … … 502 618 printf("Got %d, expected %d... ", val, dl_public_var_val); 503 619 if (val != dl_public_var_val) { 620 printf("dl_get_public_var_addr -> %p\n", 621 dl_get_public_var_addr()); 504 622 printf("FAILED\n"); 505 623 return false; … … 523 641 printf("Got %d, expected %d... ", val, 0); 524 642 if (val != 0) { 643 printf("dl_get_public_uvar_addr -> %p\n", 644 dl_get_public_uvar_addr()); 525 645 printf("FAILED\n"); 526 646 return false; … … 542 662 printf("Got %d, expected %d... ", val, dl_public_var_val); 543 663 if (val != dl_public_var_val) { 664 printf("&dl_public_var = %p, dl_get_public_var_addr -> %p\n", 665 &dl_public_var, dl_get_public_var_addr()); 544 666 printf("FAILED\n"); 545 667 return false; … … 561 683 printf("Got %d, expected %d... ", val, 0); 562 684 if (val != 0) { 685 printf("&dl_public_uvar = %p, dl_get_public_uvar_addr -> %p\n", 686 &dl_public_uvar, dl_get_public_uvar_addr()); 563 687 printf("FAILED\n"); 564 688 return false; … … 582 706 printf("Got %d, expected %d... ", val, dl_private_fib_var_val); 583 707 if (val != dl_private_fib_var_val) { 708 printf("dl_get_private_fib_var_addr -> %p\n", 709 dl_get_private_fib_var_addr()); 584 710 printf("FAILED\n"); 585 711 return false; … … 603 729 printf("Got %d, expected %d... ", val, 0); 604 730 if (val != 0) { 731 printf("dl_get_private_fib_uvar_addr -> %p\n", 732 dl_get_private_fib_var_addr()); 605 733 printf("FAILED\n"); 606 734 return false; … … 624 752 printf("Got %d, expected %d... ", val, dl_public_fib_var_val); 625 753 if (val != dl_public_fib_var_val) { 754 printf("dl_get_public_fib_var_addr -> %p\n", 755 dl_get_public_fib_var_addr()); 626 756 printf("FAILED\n"); 627 757 return false; … … 645 775 printf("Got %d, expected %d... ", val, 0); 646 776 if (val != 0) { 777 printf("dl_get_public_fib_uvar_addr -> %p\n", 778 dl_get_public_fib_uvar_addr()); 647 779 printf("FAILED\n"); 648 780 return false; … … 664 796 printf("Got %d, expected %d... ", val, dl_public_fib_var_val); 665 797 if (val != dl_public_fib_var_val) { 798 printf("&dl_public_fib_var = %p, " 799 "dl_get_public_fib_var_addr -> %p\n", 800 &dl_public_fib_var, dl_get_public_fib_var_addr()); 666 801 printf("FAILED\n"); 667 802 return false; … … 683 818 printf("Got %d, expected %d... ", val, 0); 684 819 if (val != 0) { 820 printf("&dl_public_fib_uvar = %p, " 821 "dl_get_public_fib_uvar_addr -> %p\n", 822 &dl_public_fib_uvar, dl_get_public_fib_uvar_addr()); 685 823 printf("FAILED\n"); 686 824 return false; -
uspace/lib/dltest/dltest.c
r9c07c3d r97696ab 69 69 } 70 70 71 /** Return address of private initialized variable */ 72 int *dl_get_private_var_addr(void) 73 { 74 return &private_var; 75 } 76 71 77 /** Return value of private uninitialized variable */ 72 78 int dl_get_private_uvar(void) 73 79 { 74 80 return private_uvar; 81 } 82 83 /** Return vaddress of private uninitialized variable */ 84 int *dl_get_private_uvar_addr(void) 85 { 86 return &private_uvar; 75 87 } 76 88 … … 81 93 } 82 94 95 /** Return address of public initialized variable */ 96 int *dl_get_public_var_addr(void) 97 { 98 return &dl_public_var; 99 } 100 83 101 /** Return value of public uninitialized variable */ 84 102 int dl_get_public_uvar(void) 85 103 { 86 104 return dl_public_uvar; 105 } 106 107 /** Return address of public uninitialized variable */ 108 int *dl_get_public_uvar_addr(void) 109 { 110 return &dl_public_uvar; 87 111 } 88 112 … … 93 117 } 94 118 119 /** Return address of private initialized fibril-local variable */ 120 int *dl_get_private_fib_var_addr(void) 121 { 122 return &dl_private_fib_var; 123 } 124 95 125 /** Return value of private uninitialized fibril-local variable */ 96 126 int dl_get_private_fib_uvar(void) 97 127 { 98 128 return dl_private_fib_uvar; 129 } 130 131 /** Return address of private uninitialized fibril-local variable */ 132 int *dl_get_private_fib_uvar_addr(void) 133 { 134 return &dl_private_fib_uvar; 99 135 } 100 136 … … 105 141 } 106 142 143 /** Return value of public initialized fibril-local variable */ 144 int *dl_get_public_fib_var_addr(void) 145 { 146 return &dl_public_fib_var; 147 } 148 107 149 /** Return value of public uninitialized fibril-local variable */ 108 150 int dl_get_public_fib_uvar(void) … … 111 153 } 112 154 155 /** Return value of public uninitialized fibril-local variable */ 156 int *dl_get_public_fib_uvar_addr(void) 157 { 158 return &dl_public_fib_uvar; 159 } 160 113 161 /** 114 162 * @} -
uspace/lib/dltest/libdltest.h
r9c07c3d r97696ab 49 49 extern int dl_get_constant(void); 50 50 extern int dl_get_private_var(void); 51 extern int *dl_get_private_var_addr(void); 51 52 extern int dl_get_private_uvar(void); 53 extern int *dl_get_private_uvar_addr(void); 52 54 extern int dl_get_public_var(void); 55 extern int *dl_get_public_var_addr(void); 53 56 extern int dl_get_public_uvar(void); 57 extern int *dl_get_public_uvar_addr(void); 54 58 extern int dl_get_private_fib_var(void); 59 extern int *dl_get_private_fib_var_addr(void); 55 60 extern int dl_get_private_fib_uvar(void); 61 extern int *dl_get_private_fib_uvar_addr(void); 56 62 extern int dl_get_public_fib_var(void); 63 extern int *dl_get_public_fib_var_addr(void); 57 64 extern int dl_get_public_fib_uvar(void); 65 extern int *dl_get_public_fib_uvar_addr(void); 58 66 59 67 extern int dl_public_var;
Note:
See TracChangeset
for help on using the changeset viewer.