/* -----------------------------------------------------------------------------
- * $Id: Linker.c,v 1.87 2002/04/10 11:43:45 stolz Exp $
+ * $Id: Linker.c,v 1.89 2002/05/01 15:46:14 simonmar Exp $
*
* (c) The GHC Team, 2000, 2001
*
-char*
-addDLL ( __attribute((unused)) char* path, char* dll_name )
+char *
+addDLL( char *dll_name )
{
# if defined(OBJFORMAT_ELF)
void *hdl;
- char *buf;
char *errmsg;
- if (path == NULL || strlen(path) == 0) {
- buf = stgMallocBytes(strlen(dll_name) + 10, "addDll");
- sprintf(buf, "lib%s.so", dll_name);
- } else {
- buf = stgMallocBytes(strlen(path) + 1 + strlen(dll_name) + 10, "addDll");
- sprintf(buf, "%s/lib%s.so", path, dll_name);
- }
- hdl = dlopen(buf, RTLD_NOW | RTLD_GLOBAL );
- free(buf);
+ hdl= dlopen(dll_name, RTLD_NOW | RTLD_GLOBAL);
if (hdl == NULL) {
/* dlopen failed; return a ptr to the error msg. */
errmsg = dlerror();
&& i != ehdr->e_shstrndx
/* Ignore string tables named .stabstr, as they contain
debugging info. */
- && 0 != strncmp(".stabstr", sh_strtab + shdr[i].sh_name, 8)
+ && 0 != memcmp(".stabstr", sh_strtab + shdr[i].sh_name, 8)
) {
ptr = ehdrC + shdr[i].sh_offset;
break;
&& i != ehdr->e_shstrndx
/* Ignore string tables named .stabstr, as they contain
debugging info. */
- && 0 != strncmp(".stabstr", sh_strtab + shdr[i].sh_name, 8)
+ && 0 != memcmp(".stabstr", sh_strtab + shdr[i].sh_name, 8)
) {
IF_DEBUG(linker,belch(" section %d is a normal string table", i ));
strtab = ehdrC + shdr[i].sh_offset;
relocation entries that, when done, make the stabs debugging
info point at the right places. We ain't interested in all
dat jazz, mun. */
- if (0 == strncmp(".rel.stab", sh_strtab + shdr[shnum].sh_name, 9))
+ if (0 == memcmp(".rel.stab", sh_strtab + shdr[shnum].sh_name, 9))
continue;
if (shdr[shnum].sh_type == SHT_REL ) {