Changeset 7c4b26c in mainline
- Timestamp:
- 2016-05-02T21:30:14Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 91e4567
- Parents:
- 32573ff
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r32573ff r7c4b26c 35 35 uspace/app/devctl/devctl 36 36 uspace/app/dltest/dltest 37 uspace/app/dltests/dltests 37 38 uspace/app/dnscfg/dnscfg 38 39 uspace/app/dnsres/dnsres … … 96 97 uspace/dist/app/devctl 97 98 uspace/dist/app/dltest 99 uspace/dist/app/dltests 98 100 uspace/dist/app/dnscfg 99 101 uspace/dist/app/dnsres -
boot/Makefile.common
r32573ff r7c4b26c 226 226 ifeq ($(CONFIG_BUILD_SHARED_LIBS), y) 227 227 RD_APPS_NON_ESSENTIAL += \ 228 $(USPACE_PATH)/app/dltest/dltest 228 $(USPACE_PATH)/app/dltest/dltest \ 229 $(USPACE_PATH)/app/dltests/dltests 229 230 endif 230 231 -
uspace/Makefile
r32573ff r7c4b26c 41 41 app/corecfg \ 42 42 app/devctl \ 43 app/dltest \44 43 app/dnscfg \ 45 44 app/dnsres \ … … 166 165 drv/platform/icp 167 166 167 168 168 ## Platform-specific hardware support 169 169 # … … 209 209 drv/fb/amdm37x_dispc \ 210 210 srv/hw/irc/icp-ic 211 endif 212 213 ## Dynamic linking tests 214 # 215 ifeq ($(CONFIG_BUILD_SHARED_LIBS),y) 216 DIRS += \ 217 app/dltest \ 218 app/dltests 211 219 endif 212 220 -
uspace/Makefile.common
r32573ff r7c4b26c 199 199 ifeq ($(STATIC_BUILD),y) 200 200 BASE_LIBS = $(LIBC_PREFIX)/libc.a $(LIBSOFTINT_PREFIX)/libsoftint.a 201 LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld202 201 ifeq ($(MATH),y) 203 202 BASE_LIBS += $(LIBMATH_PREFIX)/libmath.a … … 205 204 else 206 205 BASE_LIBS = $(LIBC_PREFIX)/libc.so.0 $(LIBSOFTINT_PREFIX)/libsoftint.so.0 207 LFLAGS += -Bdynamic 208 LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld 206 LINK_DYNAMIC = y 209 207 ifeq ($(MATH),y) 210 208 BASE_LIBS += $(LIBMATH_PREFIX)/libmath.so.0 211 209 endif 210 endif 211 212 ifeq ($(LINK_DYNAMIC),y) 213 LFLAGS += -Bdynamic 214 LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld 215 else 216 LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld 212 217 endif 213 218 -
uspace/app/dltest/Makefile
r32573ff r7c4b26c 28 28 29 29 USPACE_PREFIX = ../.. 30 EXTRA_CFLAGS = -I$(LIBDLTEST_PREFIX) 30 EXTRA_CFLAGS = -I$(LIBDLTEST_PREFIX) -DDLTEST_LINKED 31 LIBS = $(LIBDLTEST_PREFIX)/libdltest.so.0.0 32 # Need a dynamic link, but possibly still use static libc 33 LINK_DYNAMIC = y 34 31 35 BINARY = dltest 32 36 -
uspace/app/dltest/dltest.c
r32573ff r7c4b26c 45 45 void *handle; 46 46 47 47 48 /** Test dlsym() function */ 48 49 static bool test_dlsym(void) … … 255 256 } 256 257 258 #ifdef DLTEST_LINKED 259 260 /** Test directly calling function that returns a constant */ 261 static bool test_lnk_dl_get_constant(void) 262 { 263 int val; 264 265 printf("Call linked dl_get_constant...\n"); 266 267 val = dl_get_constant(); 268 269 printf("Got %d, expected %d... ", val, dl_constant); 270 if (val != dl_constant) { 271 printf("FAILED\n"); 272 return false; 273 } 274 275 printf("Passed\n"); 276 return true; 277 } 278 279 /** Test dircetly calling a function that returns contents of a private 280 * initialized variable. 281 */ 282 static bool test_lnk_dl_get_private_var(void) 283 { 284 int val; 285 286 printf("Call linked dl_get_private_var...\n"); 287 288 val = dl_get_private_var(); 289 290 printf("Got %d, expected %d... ", val, dl_private_var_val); 291 if (val != dl_private_var_val) { 292 printf("FAILED\n"); 293 return false; 294 } 295 296 printf("Passed\n"); 297 return true; 298 } 299 300 /** Test dircetly calling a function that returns contents of a private 301 * uninitialized variable. 302 */ 303 static bool test_lnk_dl_get_private_uvar(void) 304 { 305 int val; 306 307 printf("Call linked dl_get_private_uvar...\n"); 308 309 val = dl_get_private_uvar(); 310 311 printf("Got %d, expected %d... ", val, 0); 312 if (val != 0) { 313 printf("FAILED\n"); 314 return false; 315 } 316 317 printf("Passed\n"); 318 return true; 319 } 320 321 /** Test directly calling a function that returns the contents of a public 322 * initialized variable. 323 */ 324 static bool test_lnk_dl_get_public_var(void) 325 { 326 int val; 327 328 printf("Call linked dl_get_public_var...\n"); 329 330 val = dl_get_public_var(); 331 332 printf("Got %d, expected %d... ", val, dl_public_var_val); 333 if (val != dl_public_var_val) { 334 printf("FAILED\n"); 335 return false; 336 } 337 338 printf("Passed\n"); 339 return true; 340 } 341 342 /** Test directly calling a function that returns the contents of a public 343 * uninitialized variable. 344 */ 345 static bool test_lnk_dl_get_public_uvar(void) 346 { 347 int val; 348 349 printf("Call linked dl_get_public_uvar...\n"); 350 351 val = dl_get_public_uvar(); 352 353 printf("Got %d, expected %d... ", val, 0); 354 if (val != 0) { 355 printf("FAILED\n"); 356 return false; 357 } 358 359 printf("Passed\n"); 360 return true; 361 } 362 363 /** Test directly reading a public initialized variable. */ 364 static bool test_lnk_read_public_var(void) 365 { 366 int val; 367 368 printf("Read linked dl_public_var...\n"); 369 370 val = dl_public_var; 371 372 printf("Got %d, expected %d... ", val, dl_public_var_val); 373 if (val != dl_public_var_val) { 374 printf("FAILED\n"); 375 return false; 376 } 377 378 printf("Passed\n"); 379 return true; 380 } 381 382 /** Test directly reading a public uninitialized variable. */ 383 static bool test_lnk_read_public_uvar(void) 384 { 385 int val; 386 387 printf("Read linked dl_public_uvar...\n"); 388 389 val = dl_public_uvar; 390 391 printf("Got %d, expected %d... ", val, 0); 392 if (val != 0) { 393 printf("FAILED\n"); 394 return false; 395 } 396 397 printf("Passed\n"); 398 return true; 399 } 400 401 #endif 402 257 403 int main(int argc, char *argv[]) 258 404 { … … 293 439 return 1; 294 440 441 #ifdef DLTEST_LINKED 442 if (!test_lnk_dl_get_constant()) 443 return 1; 444 445 if (!test_lnk_dl_get_private_var()) 446 return 1; 447 448 if (!test_lnk_dl_get_private_uvar()) 449 return 1; 450 451 if (!test_lnk_dl_get_public_var()) 452 return 1; 453 454 if (!test_lnk_dl_get_public_uvar()) 455 return 1; 456 457 if (!test_lnk_read_public_var()) 458 return 1; 459 460 if (!test_lnk_read_public_uvar()) 461 return 1; 462 #endif 295 463 // printf("dlclose()... "); 296 464 // dlclose(handle);
Note:
See TracChangeset
for help on using the changeset viewer.