diff options
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -253,9 +253,11 @@ int main() | |||
253 | } | 253 | } |
254 | else | 254 | else |
255 | printf( "SUCCESS\tGot symbol from global handle: %p\n", *(void **) (&fwrite_local) ); | 255 | printf( "SUCCESS\tGot symbol from global handle: %p\n", *(void **) (&fwrite_local) ); |
256 | char * hello_world = "Hello world from local fwrite!\n"; | 256 | { |
257 | fwrite_local(hello_world,sizeof(char),strlen(hello_world),stderr); | 257 | const char *hello_world = "Hello world from local fwrite!\n"; |
258 | fflush(stderr); | 258 | fwrite_local( hello_world, sizeof( char ), strlen( hello_world ), stderr ); |
259 | fflush( stderr ); | ||
260 | } | ||
259 | 261 | ||
260 | *(void **) (&fputs_default) = dlsym( RTLD_DEFAULT, "fputs" ); | 262 | *(void **) (&fputs_default) = dlsym( RTLD_DEFAULT, "fputs" ); |
261 | if (!fputs_default) | 263 | if (!fputs_default) |
@@ -269,9 +271,11 @@ int main() | |||
269 | } | 271 | } |
270 | else | 272 | else |
271 | printf( "SUCCESS\tGot symbol from default handle: %p\n", *(void **) (&fputs_default) ); | 273 | printf( "SUCCESS\tGot symbol from default handle: %p\n", *(void **) (&fputs_default) ); |
272 | char * hello_world_fputs = "Hello world from default fputs!\n"; | 274 | { |
273 | fputs_default(hello_world_fputs, stderr); | 275 | const char *hello_world_fputs = "Hello world from default fputs!\n"; |
274 | fflush(stderr); | 276 | fputs_default( hello_world_fputs, stderr ); |
277 | fflush( stderr ); | ||
278 | } | ||
275 | 279 | ||
276 | *(void **) (&function) = dlsym( library, "function" ); | 280 | *(void **) (&function) = dlsym( library, "function" ); |
277 | if( !function ) | 281 | if( !function ) |