Skip to content
Snippets Groups Projects
Commit efc6b559 authored by Vivek Das Mohapatra's avatar Vivek Das Mohapatra
Browse files

Fix indentation in generated stub library

parent cf2738cb
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -76,7 +76,7 @@ do ...@@ -76,7 +76,7 @@ do
case $excluded in lib*) printf "%32s \"%s\",\n" "" $excluded; ;; esac; case $excluded in lib*) printf "%32s \"%s\",\n" "" $excluded; ;; esac;
done < $proxy_excluded; done < $proxy_excluded;
cat - <<EOF cat - <<EOF
NULL }; NULL };
EOF EOF
if [ -f ${dlopen_file} ]; if [ -f ${dlopen_file} ];
...@@ -110,49 +110,49 @@ cat - <<EOF ...@@ -110,49 +110,49 @@ cat - <<EOF
static void __attribute__ ((constructor)) _capsule_init (void) static void __attribute__ ((constructor)) _capsule_init (void)
{ {
int capsule_errno = 0; int capsule_errno = 0;
char *capsule_error = NULL; char *capsule_error = NULL;
// this is an array of the functions we want to act as a shim for: // this is an array of the functions we want to act as a shim for:
capsule_item_t relocs[] = capsule_item_t relocs[] =
{ {
EOF EOF
while read sym x; do echo " { \"$sym\" },"; done < $symbol_file; while read sym x; do echo " { \"$sym\" },"; done < $symbol_file;
cat - <<EOF cat - <<EOF
{ NULL } { NULL }
}; };
// and this is an aray of functions we must override in the DSOs // and this is an aray of functions we must override in the DSOs
// inside the capsule (mostly to take account of the fact that // inside the capsule (mostly to take account of the fact that
// they're pulled in from a tree with a filesystem prefix like /host) // they're pulled in from a tree with a filesystem prefix like /host)
// NOTE: the shim address here isn't used, but we give it the same // NOTE: the shim address here isn't used, but we give it the same
// value as the real function address so it's never accidentally // value as the real function address so it's never accidentally
// a value the capsule code will care about: // a value the capsule code will care about:
capsule_item_t wrappers[] = capsule_item_t wrappers[] =
{ {
{ "dlopen", (ElfW(Addr)) _dlopen, (ElfW(Addr)) _dlopen }, { "dlopen", (ElfW(Addr)) _dlopen, (ElfW(Addr)) _dlopen },
{ NULL } { NULL }
}; };
symbol_ns = LM_ID_NEWLM; symbol_ns = LM_ID_NEWLM;
prefix = "/host"; prefix = "/host";
capsule_init(); capsule_init();
dso = capsule_dlmopen( "$proxied_dso", prefix, &symbol_ns, wrappers, dso = capsule_dlmopen( "$proxied_dso", prefix, &symbol_ns, wrappers,
0, exclude, &capsule_errno, &capsule_error ); 0, exclude, &capsule_errno, &capsule_error );
if( dso ) if( dso )
{ {
capsule_relocate( "$proxied_dso", dso, 0, relocs, &capsule_error ); capsule_relocate( "$proxied_dso", dso, 0, relocs, &capsule_error );
} }
else else
{ {
fprintf( stderr, "capsule_dlmopen() failed: %s\\n", capsule_error ); fprintf( stderr, "capsule_dlmopen() failed: %s\\n", capsule_error );
exit( 1 ); exit( 1 );
} }
} }
EOF EOF
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment