base-linux: support hybrid mode in lx_rmap test

In hybrid mode, all programs are dynamic executables and ld.lib.so is
not supported. Therefore, only the "static" variant of the test can be
build and executed.
This commit is contained in:
Christian Helmuth 2013-10-15 10:45:41 +02:00 committed by Norman Feske
parent 74425bd918
commit f845be8c23
3 changed files with 25 additions and 9 deletions

View File

@ -6,11 +6,6 @@
assert_spec linux
if {[have_spec always_hybrid]} {
puts "\nTest does not support always_hybrid mode."
exit 0
}
#
# Build
#

View File

@ -1,3 +1,8 @@
# dynamic variant is not supported in hybrid mode
ifeq ($(filter-out $(SPECS),always_hybrid),)
REQUIRES = plain_linux
endif
TARGET = test-lx_rmap_dynamic
SRC_CC = main.cc
LIBS = base libc

View File

@ -21,7 +21,23 @@
#include <rm_session/connection.h>
extern "C" void wait_for_continue();
static void blob() __attribute__((used));
static void blob()
{
asm volatile (
".balign 4096, -1\n"
"blob_beg:\n"
".space 16*4096, -2\n"
"blob_end:\n"
".global blob_beg\n"
".global blob_end\n"
: : : );
}
extern unsigned long blob_beg;
extern unsigned long blob_end;
int main()
@ -37,12 +53,12 @@ int main()
env()->heap()->free(addr, 0);
}
addr_t beg((addr_t)&_prog_img_beg);
addr_t end(align_addr((addr_t)&_prog_img_end, 12));
addr_t beg((addr_t)&blob_beg);
addr_t end(align_addr((addr_t)&blob_end, 12));
size_t size(end - beg);
PLOG("program-image region [%016lx,%016lx) size=%zx", beg, end, size);
PLOG("blob region region [%016lx,%016lx) size=%zx", beg, end, size);
/* RAM dataspace attachment overlapping binary */
try {