libdl: Fix the tests loading the correct files

This commit is contained in:
Chris Johns
2018-04-12 17:48:28 +10:00
parent f59d435d16
commit 696b9121a2
6 changed files with 18 additions and 18 deletions

View File

@@ -364,7 +364,7 @@ dl02-o2.o: dl02/dl-o2.c Makefile
$(AM_V_CC)$(COMPILE) -c -o $@ $< $(AM_V_CC)$(COMPILE) -c -o $@ $<
dl02.tar: dl02-o1.o dl02-o2.o dl02.tar: dl02-o1.o dl02-o2.o
@rm -f $@ @rm -f $@
$(AM_V_GEN)$(PAX) -w -f $@ $< $(AM_V_GEN)$(PAX) -w -f $@ $+
dl02-tar.c: dl02.tar dl02-tar.c: dl02.tar
$(AM_V_GEN)$(BIN2C) -C $< $@ $(AM_V_GEN)$(BIN2C) -C $< $@
dl02-tar.h: dl02.tar dl02-tar.h: dl02.tar

View File

@@ -28,9 +28,9 @@ int dl_load_test(void)
int unresolved; int unresolved;
char* message = "loaded"; char* message = "loaded";
printf("load: /dl-o1.o\n"); printf("load: /dl01-o1.o\n");
handle = dlopen ("/dl-o1.o", RTLD_NOW | RTLD_GLOBAL); handle = dlopen ("/dl01-o1.o", RTLD_NOW | RTLD_GLOBAL);
if (!handle) if (!handle)
{ {
printf("dlopen failed: %s\n", dlerror()); printf("dlopen failed: %s\n", dlerror());

View File

@@ -49,10 +49,10 @@ int dl_load_test(void)
int call_ret; int call_ret;
int ret; int ret;
o1 = dl_load_obj("/dl-o1.o"); o1 = dl_load_obj("/dl02-o1.o");
if (!o1) if (!o1)
return 1; return 1;
o2 = dl_load_obj("/dl-o2.o"); o2 = dl_load_obj("/dl02-o2.o");
if (!o1) if (!o1)
return 1; return 1;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016 Chris Johns <chrisj@rtems.org>. All rights reserved. * Copyright (c) 2016, 2018 Chris Johns <chrisj@rtems.org>. All rights reserved.
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at * found in the file LICENSE in this distribution or at
@@ -63,7 +63,7 @@ static bool dl_cache_check(void* buffer, off_t offset, size_t length)
return memcmp(buffer, contents + offset, length) == 0; return memcmp(buffer, contents + offset, length) == 0;
} }
static off_t dl_cache_buffer_offset(rtems_rtl_obj_cache_t* cache, void* buffer) static off_t dl_cache_buffer_offset(rtems_rtl_obj_cache* cache, void* buffer)
{ {
return (off_t) (((uint8_t*) buffer) - ((uint8_t*) cache->buffer)); return (off_t) (((uint8_t*) buffer) - ((uint8_t*) cache->buffer));
} }
@@ -73,22 +73,22 @@ static void dl_init_rtl(void)
/* /*
* Check the RTL object is created and can be locked and unlocked. * Check the RTL object is created and can be locked and unlocked.
*/ */
rtems_test_assert(rtems_rtl_data () == NULL); rtems_test_assert(rtems_rtl_data_unprotected () == NULL);
rtems_test_assert(rtems_rtl_lock () != NULL); rtems_test_assert(rtems_rtl_lock () != NULL);
rtems_rtl_unlock (); rtems_rtl_unlock ();
rtems_test_assert(rtems_rtl_data () != NULL); rtems_test_assert(rtems_rtl_data_unprotected () != NULL);
rtems_rtl_trace_set_mask(RTEMS_RTL_TRACE_ALL | RTEMS_RTL_TRACE_CACHE); rtems_rtl_trace_set_mask(RTEMS_RTL_TRACE_ALL | RTEMS_RTL_TRACE_CACHE);
} }
int dl_cache_test(void) int dl_cache_test(void)
{ {
rtems_rtl_obj_cache_t cache; rtems_rtl_obj_cache cache;
int fd; int fd;
void* buffer; void* buffer;
off_t offset_in; off_t offset_in;
off_t offset; off_t offset;
size_t length_in; size_t length_in;
size_t length; size_t length;
/* /*
* Make sure the RTL can initialise. * Make sure the RTL can initialise.

View File

@@ -26,7 +26,7 @@ int dl_load_test(void)
const char* err; const char* err;
rtems_rtl_trace_set_mask(RTEMS_RTL_TRACE_ALL); rtems_rtl_trace_set_mask(RTEMS_RTL_TRACE_ALL);
handle = dlopen("/dl-o4.o", RTLD_GLOBAL | RTLD_NOW); handle = dlopen("/dl04-o4.o", RTLD_GLOBAL | RTLD_NOW);
err = dlerror(); err = dlerror();
if (err != NULL) if (err != NULL)
printf("dlopen: %s\n", err); printf("dlopen: %s\n", err);

View File

@@ -36,7 +36,7 @@ int dl_load_test(void)
rtems_rtl_trace_set_mask(RTEMS_RTL_TRACE_ALL); rtems_rtl_trace_set_mask(RTEMS_RTL_TRACE_ALL);
handle = dlopen("/dl-o5.o", RTLD_GLOBAL | RTLD_NOW); handle = dlopen("/dl05-o5.o", RTLD_GLOBAL | RTLD_NOW);
if (handle == NULL) if (handle == NULL)
{ {
err = dlerror(); err = dlerror();