log is the log from gcc-lperl test.c
log.save is the log from gcc -lperl -lpthread test.c

log = segfaults
log.save = works
--- log	2007-05-15 18:35:52 -0500
+++ log.save	2007-05-15 18:34:34 -0500
@@ -4,73 +4,76 @@
 _dl_load_shared_library:298: 	searching ldso dir='/lib'
 _dl_load_elf_shared_library:639: 
 	file='/lib/libperl.so';  generating link map
-_dl_load_elf_shared_library:640: 		dynamic: 0xb7fcb424  base: 0xb7eb8000
-_dl_load_elf_shared_library:642: 		  entry: 0xb7ed7a00  phdr: 0xb7eb8034  phnum: 0x5
+_dl_load_elf_shared_library:640: 		dynamic: 0xb7f2a424  base: 0xb7e17000
+_dl_load_elf_shared_library:642: 		  entry: 0xb7e36a00  phdr: 0xb7e17034  phnum: 0x5
+
+_dl_get_ready_to_run:587: 	file='libpthread.so.0';  needed by './a.out'
+_dl_load_shared_library:222: 	find library='libpthread.so.0'; searching
+_dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
+_dl_load_elf_shared_library:639: 
+	file='/lib/libpthread.so.0';  generating link map
+_dl_load_elf_shared_library:640: 		dynamic: 0xb7e0fec4  base: 0xb7e02000
+_dl_load_elf_shared_library:642: 		  entry: 0xb7e05e40  phdr: 0xb7e02034  phnum: 0x7
 
 _dl_get_ready_to_run:587: 	file='libintl.so.8';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libintl.so.8'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
 _dl_load_elf_shared_library:639: 
 	file='/lib/libintl.so.8';  generating link map
-_dl_load_elf_shared_library:640: 		dynamic: 0xb7eb7834  base: 0xb7eaf000
-_dl_load_elf_shared_library:642: 		  entry: 0xb7eb0490  phdr: 0xb7eaf034  phnum: 0x4
+_dl_load_elf_shared_library:640: 		dynamic: 0xb7e01834  base: 0xb7df9000
+_dl_load_elf_shared_library:642: 		  entry: 0xb7dfa490  phdr: 0xb7df9034  phnum: 0x4
 
 _dl_get_ready_to_run:587: 	file='libc.so.0';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libc.so.0'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
 _dl_load_elf_shared_library:639: 
 	file='/lib/libc.so.0';  generating link map
-_dl_load_elf_shared_library:640: 		dynamic: 0xb7ea3e6c  base: 0xb7df4000
-_dl_load_elf_shared_library:642: 		  entry: 0xb7dfed70  phdr: 0xb7df4034  phnum: 0x7
+_dl_load_elf_shared_library:640: 		dynamic: 0xb7dede6c  base: 0xb7d3e000
+_dl_load_elf_shared_library:642: 		  entry: 0xb7d48d70  phdr: 0xb7d3e034  phnum: 0x7
 
 _dl_get_ready_to_run:587: 	file='libnsl.so.0';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libnsl.so.0'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
 _dl_load_elf_shared_library:639: 
 	file='/lib/libnsl.so.0';  generating link map
-_dl_load_elf_shared_library:640: 		dynamic: 0xb7df3f8c  base: 0xb7df2000
-_dl_load_elf_shared_library:642: 		  entry: 0xb7df220c  phdr: 0xb7df2034  phnum: 0x7
+_dl_load_elf_shared_library:640: 		dynamic: 0xb7d3df8c  base: 0xb7d3c000
+_dl_load_elf_shared_library:642: 		  entry: 0xb7d3c20c  phdr: 0xb7d3c034  phnum: 0x7
 
 _dl_get_ready_to_run:587: 	file='libdl.so.0';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libdl.so.0'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
 _dl_load_elf_shared_library:639: 
 	file='/lib/libdl.so.0';  generating link map
-_dl_load_elf_shared_library:640: 		dynamic: 0xb7df0f24  base: 0xb7ded000
-_dl_load_elf_shared_library:642: 		  entry: 0xb7ded834  phdr: 0xb7ded034  phnum: 0x7
+_dl_load_elf_shared_library:640: 		dynamic: 0xb7d3af24  base: 0xb7d37000
+_dl_load_elf_shared_library:642: 		  entry: 0xb7d37834  phdr: 0xb7d37034  phnum: 0x7
 
 _dl_get_ready_to_run:587: 	file='libm.so.0';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libm.so.0'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
 _dl_load_elf_shared_library:639: 
 	file='/lib/libm.so.0';  generating link map
-_dl_load_elf_shared_library:640: 		dynamic: 0xb7debf6c  base: 0xb7ddd000
-_dl_load_elf_shared_library:642: 		  entry: 0xb7dde174  phdr: 0xb7ddd034  phnum: 0x7
+_dl_load_elf_shared_library:640: 		dynamic: 0xb7d35f6c  base: 0xb7d27000
+_dl_load_elf_shared_library:642: 		  entry: 0xb7d28174  phdr: 0xb7d27034  phnum: 0x7
 
 _dl_get_ready_to_run:587: 	file='libcrypt.so.0';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libcrypt.so.0'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
 _dl_load_elf_shared_library:639: 
 	file='/lib/libcrypt.so.0';  generating link map
-_dl_load_elf_shared_library:640: 		dynamic: 0xb7dcaf6c  base: 0xb7dc7000
-_dl_load_elf_shared_library:642: 		  entry: 0xb7dc7448  phdr: 0xb7dc7034  phnum: 0x7
+_dl_load_elf_shared_library:640: 		dynamic: 0xb7d14f6c  base: 0xb7d11000
+_dl_load_elf_shared_library:642: 		  entry: 0xb7d11448  phdr: 0xb7d11034  phnum: 0x7
 
 _dl_get_ready_to_run:587: 	file='libutil.so.0';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libutil.so.0'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
 _dl_load_elf_shared_library:639: 
 	file='/lib/libutil.so.0';  generating link map
-_dl_load_elf_shared_library:640: 		dynamic: 0xb7dc5f6c  base: 0xb7dc4000
-_dl_load_elf_shared_library:642: 		  entry: 0xb7dc4820  phdr: 0xb7dc4034  phnum: 0x7
+_dl_load_elf_shared_library:640: 		dynamic: 0xb7d0ff6c  base: 0xb7d0e000
+_dl_load_elf_shared_library:642: 		  entry: 0xb7d0e820  phdr: 0xb7d0e034  phnum: 0x7
 
 _dl_get_ready_to_run:587: 	file='libpthread.so.0';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libpthread.so.0'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
-_dl_load_elf_shared_library:639: 
-	file='/lib/libpthread.so.0';  generating link map
-_dl_load_elf_shared_library:640: 		dynamic: 0xb7dbcec4  base: 0xb7daf000
-_dl_load_elf_shared_library:642: 		  entry: 0xb7db2e40  phdr: 0xb7daf034  phnum: 0x7
-
 _dl_get_ready_to_run:587: 	file='libc.so.0';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libc.so.0'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
@@ -80,12 +83,12 @@
 _dl_get_ready_to_run:587: 	file='libc.so.0';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libc.so.0'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
-_dl_get_ready_to_run:587: 	file='libintl.so.8';  needed by './a.out'
-_dl_load_shared_library:222: 	find library='libintl.so.8'; searching
-_dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
 _dl_get_ready_to_run:587: 	file='libc.so.0';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libc.so.0'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
+_dl_get_ready_to_run:587: 	file='libintl.so.8';  needed by './a.out'
+_dl_load_shared_library:222: 	find library='libintl.so.8'; searching
+_dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
 _dl_get_ready_to_run:587: 	file='libc.so.0';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libc.so.0'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
@@ -101,16 +104,17 @@
 _dl_get_ready_to_run:587: 	file='libc.so.0';  needed by './a.out'
 _dl_load_shared_library:222: 	find library='libc.so.0'; searching
 _dl_load_shared_library:283: 	searching cache='/etc/ld.so.cache'
-_dl_get_ready_to_run:643: Move /lib/libnsl.so.0 from pos 3 to 2 in INIT/FINI list
-_dl_get_ready_to_run:643: Move /lib/libdl.so.0 from pos 4 to 3 in INIT/FINI list
-_dl_get_ready_to_run:643: Move /lib/libm.so.0 from pos 5 to 4 in INIT/FINI list
-_dl_get_ready_to_run:643: Move /lib/libcrypt.so.0 from pos 6 to 5 in INIT/FINI list
-_dl_get_ready_to_run:643: Move /lib/libutil.so.0 from pos 7 to 6 in INIT/FINI list
-_dl_get_ready_to_run:643: Move /lib/libpthread.so.0 from pos 8 to 7 in INIT/FINI list
+_dl_get_ready_to_run:643: Move /lib/libnsl.so.0 from pos 4 to 3 in INIT/FINI list
+_dl_get_ready_to_run:643: Move /lib/libdl.so.0 from pos 5 to 4 in INIT/FINI list
+_dl_get_ready_to_run:643: Move /lib/libm.so.0 from pos 6 to 5 in INIT/FINI list
+_dl_get_ready_to_run:643: Move /lib/libcrypt.so.0 from pos 7 to 6 in INIT/FINI list
+_dl_get_ready_to_run:643: Move /lib/libutil.so.0 from pos 8 to 7 in INIT/FINI list
 
 INIT/FINI order and dependencies:
 lib: /lib/libperl.so has deps:
  /lib/libintl.so.8  /lib/libc.so.0  /lib/libpthread.so.0  /lib/libutil.so.0  /lib/libcrypt.so.0  /lib/libm.so.0  /lib/libdl.so.0  /lib/libnsl.so.0 
+lib: /lib/libpthread.so.0 has deps:
+ /lib/libc.so.0 
 lib: /lib/libintl.so.8 has deps:
  /lib/libintl.so.8  /lib/libc.so.0 
 lib: /lib/libnsl.so.0 has deps:
@@ -123,11 +127,8 @@
  /lib/libc.so.0 
 lib: /lib/libutil.so.0 has deps:
  /lib/libc.so.0 
-lib: /lib/libpthread.so.0 has deps:
- /lib/libc.so.0 
 lib: /lib/libc.so.0 has deps:
 
-_dl_fixup:664: relocation processing: /lib/libpthread.so.0
 _dl_fixup:664: relocation processing: /lib/libutil.so.0
 _dl_fixup:664: relocation processing: /lib/libcrypt.so.0
 _dl_fixup:664: relocation processing: /lib/libm.so.0
@@ -135,18 +136,34 @@
 _dl_fixup:664: relocation processing: /lib/libnsl.so.0
 _dl_fixup:664: relocation processing: /lib/libc.so.0
 _dl_fixup:664: relocation processing: /lib/libintl.so.8
+_dl_fixup:664: relocation processing: /lib/libpthread.so.0
 _dl_fixup:664: relocation processing: /lib/libperl.so
 _dl_fixup:664: relocation processing: ./a.out
-_dl_protect_relro:124: RELRO protecting /lib/libc.so.0:  start:0xb7ea3000, end:0xb7ea4000
-_dl_protect_relro:124: RELRO protecting /lib/libnsl.so.0:  start:0xb7df3000, end:0xb7df4000
-_dl_protect_relro:124: RELRO protecting /lib/libdl.so.0:  start:0xb7df0000, end:0xb7df1000
-_dl_protect_relro:124: RELRO protecting /lib/libm.so.0:  start:0xb7deb000, end:0xb7dec000
-_dl_protect_relro:124: RELRO protecting /lib/libcrypt.so.0:  start:0xb7dca000, end:0xb7dcb000
-_dl_protect_relro:124: RELRO protecting /lib/libutil.so.0:  start:0xb7dc5000, end:0xb7dc6000
-_dl_protect_relro:124: RELRO protecting /lib/libpthread.so.0:  start:0xb7dbc000, end:0xb7dbd000
-_dl_protect_relro:124: RELRO protecting /lib/ld-uClibc.so.0:  start:0xb7fdd000, end:0xb7fde000
+_dl_protect_relro:124: RELRO protecting /lib/libpthread.so.0:  start:0xb7e0f000, end:0xb7e10000
+_dl_protect_relro:124: RELRO protecting /lib/libc.so.0:  start:0xb7ded000, end:0xb7dee000
+_dl_protect_relro:124: RELRO protecting /lib/libnsl.so.0:  start:0xb7d3d000, end:0xb7d3e000
+_dl_protect_relro:124: RELRO protecting /lib/libdl.so.0:  start:0xb7d3a000, end:0xb7d3b000
+_dl_protect_relro:124: RELRO protecting /lib/libm.so.0:  start:0xb7d35000, end:0xb7d36000
+_dl_protect_relro:124: RELRO protecting /lib/libcrypt.so.0:  start:0xb7d14000, end:0xb7d15000
+_dl_protect_relro:124: RELRO protecting /lib/libutil.so.0:  start:0xb7d0f000, end:0xb7d10000
+_dl_protect_relro:124: RELRO protecting /lib/ld-uClibc.so.0:  start:0xb7f3c000, end:0xb7f3d000
 _dl_get_ready_to_run:814: calling INIT: /lib/libc.so.0
 
+_dl_get_ready_to_run:814: calling INIT: /lib/libintl.so.8
+
 _dl_get_ready_to_run:814: calling INIT: /lib/libpthread.so.0
 
-Segmentation fault
+_dl_get_ready_to_run:814: calling INIT: /lib/libperl.so
+
+_dl_fini:126: 
+calling FINI: /lib/libperl.so
+
+_dl_fini:126: 
+calling FINI: /lib/libpthread.so.0
+
+_dl_fini:126: 
+calling FINI: /lib/libintl.so.8
+
+_dl_fini:126: 
+calling FINI: /lib/libdl.so.0
+
