+2003-05-29 Gary V. Vaughan <gary@gnu.org>
+
+ * libltdl/ltdl.c (lt_int_dyld_lib_install_name): Removed unused
+ variable mh1.
+ (sys_dyld_close): Removed unused variable size.
+
2003-05-21 Bruno Haible <bruno@clisp.org>
* libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER): Add support for
* f77demo/configure.ac: Add config.h which was misapplied previously.
2003-03-20 Peter O'Gorman <peter@pogma.com>
-
+
* ltmain.in: Always use $echo not echo for consistency.
Changes for darwin building. Warn if linking against libs linked
with -module. Use module_cmds if available and building a module,
(_LT_AC_LANG_CXX_CONFIG): Preserve variables used by AC_PROG_LD,
and reset them for a C++ environment. Use the with_gnu_ld setting
from AC_PROG_LD.
-
+
* libtool.m4: Replace $linker_flags with $compiler_flags wherever
it is used as argument to $CC.
* ltmain.in: add code for a binary wrapper
to use with uninstalled executables on cygwin/mingw.
Make sure that --mode=clean gets shell wrapper and
- binary wrapper. When sourcing the shell wrapper,
- invoke using a terminal `.' on cygwin/mingw to
+ binary wrapper. When sourcing the shell wrapper,
+ invoke using a terminal `.' on cygwin/mingw to
avoid the automatic append-.exe behavior.
2003-01-28 Albert Chin-A-Young <china@thewrittenword.com>
Call that instead.
2002-12-30 Robert Boehne <rboehne@gnu.org>
-
+
* libtool.m4 (AC_LIBTOOL_LANG_CXX_CONFIG): Copy the section
for Darwin from AC_LIBTOOL_PROG_LD_SHLIBS so that the CXX
tag doesn't use the g++ defaults for the OS X compiler.
static enum DYLD_BOOL (*ltdl_NSMakePrivateModulePublic)(NSModule module) = 0;
#ifndef NSADDIMAGE_OPTION_NONE
-#define NSADDIMAGE_OPTION_NONE 0x0
+#define NSADDIMAGE_OPTION_NONE 0x0
#endif
#ifndef NSADDIMAGE_OPTION_RETURN_ON_ERROR
#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1
-#endif
+#endif
#ifndef NSADDIMAGE_OPTION_WITH_SEARCHING
#define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2
-#endif
+#endif
#ifndef NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED
#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4
#endif
#endif
#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND
#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0
-#endif
+#endif
#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW
#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1
#endif
int lerno;
const char *errstr;
const char *file;
- NSLinkEditError(&ler,&lerno,&file,&errstr);
+ NSLinkEditError(&ler,&lerno,&file,&errstr);
if (!errstr || !strlen(errstr)) errstr = othererror;
return errstr;
}
-
+
static const struct mach_header *
lt_int_dyld_get_mach_header_from_nsmodule(module)
NSModule module;
static const char* lt_int_dyld_lib_install_name(mh)
const struct mach_header *mh;
-{
+{
/* NSAddImage is also used to get the loaded image, but it only works if the lib
is installed, for uninstalled libs we need to check the install_names against
each other. Note that this is still broken if DYLD_IMAGE_SUFFIX is set and a
int j;
struct load_command *lc;
unsigned long offset = sizeof(struct mach_header);
- const struct mach_header *mh1;
const char* retStr=NULL;
for (j = 0; j < mh->ncmds; j++)
{
lc = (struct load_command*)(((unsigned long)mh) + offset);
if (LC_ID_DYLIB == lc->cmd)
{
- retStr=(char*)(((struct dylib_command*)lc)->dylib.name.offset +
+ retStr=(char*)(((struct dylib_command*)lc)->dylib.name.offset +
(unsigned long)lc);
}
offset += lc->cmdsize;
int i=_dyld_image_count();
int j;
const struct mach_header *mh=NULL;
- const char *id=NULL;
+ const char *id=NULL;
for (j = 0; j < i; j++)
{
id=lt_int_dyld_lib_install_name(_dyld_get_image_header(j));
}
return mh;
}
-
+
static NSSymbol
lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh)
const char *symbol;
lc = (struct load_command*)(((unsigned long)mh) + offset);
if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd))
{
- mh1=lt_int_dyld_match_loaded_lib_by_install_name((char*)(((struct dylib_command*)lc)->dylib.name.offset +
+ mh1=lt_int_dyld_match_loaded_lib_by_install_name((char*)(((struct dylib_command*)lc)->dylib.name.offset +
(unsigned long)lc));
if (!mh1)
- {
- /* Maybe NSAddImage can find it */
- mh1=ltdl_NSAddImage((char*)(((struct dylib_command*)lc)->dylib.name.offset +
+ {
+ /* Maybe NSAddImage can find it */
+ mh1=ltdl_NSAddImage((char*)(((struct dylib_command*)lc)->dylib.name.offset +
(unsigned long)lc),
- NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED +
+ NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED +
NSADDIMAGE_OPTION_WITH_SEARCHING +
NSADDIMAGE_OPTION_RETURN_ON_ERROR );
- }
+ }
if (mh1)
{
retSym = ltdl_NSLookupSymbolInImage(mh1,
symbol,
- NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW
+ NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW
| NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR
);
- if (retSym) break;
- }
+ if (retSym) break;
+ }
}
offset += lc->cmdsize;
}
{
int retCode = 0;
int err = 0;
- if (!_dyld_present()) {
+ if (!_dyld_present()) {
retCode=1;
}
else {
lt_module module = 0;
NSObjectFileImage ofi = 0;
NSObjectFileImageReturnCode ofirc;
-
- if (!filename)
+
+ if (!filename)
return (lt_module)-1;
ofirc = NSCreateObjectFileImageFromFile(filename, &ofi);
switch (ofirc)
case NSObjectFileImageInappropriateFile:
if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage)
{
- module = (lt_module)ltdl_NSAddImage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+ module = (lt_module)ltdl_NSAddImage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
break;
- }
+ }
default:
LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN)));
return 0;
{
int retCode = 0;
int flags = 0;
- unsigned long size=0;
if (module == (lt_module)-1) return 0;
-#ifdef __BIG_ENDIAN__
+#ifdef __BIG_ENDIAN__
if (((struct mach_header *)module)->magic == MH_MAGIC)
-#else
+#else
if (((struct mach_header *)module)->magic == MH_CIGAM)
-#endif
+#endif
{
LT_DLMUTEX_SETERROR("Can not close a dylib");
retCode = 1;
/* Currently, if a module contains c++ static destructors and it is unloaded, we
get a segfault in atexit(), due to compiler and dynamic loader differences of
opinion, this works around that.
-*/
- if ((const struct section *)NULL !=
+*/
+ if ((const struct section *)NULL !=
getsectbynamefromheader(lt_int_dyld_get_mach_header_from_nsmodule(module),
"__DATA","__mod_term_func"))
{
flags += NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED;
- }
-#endif
+ }
+#endif
#ifdef __ppc__
flags += NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES;
#endif
{
retCode=1;
LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_CLOSE)));
- }
+ }
}
-
+
return retCode;
}
_dyld_lookup_and_bind(symbol,(unsigned long*)&address,&unused);
return address;
}
-#ifdef __BIG_ENDIAN__
+#ifdef __BIG_ENDIAN__
if (((struct mach_header *)module)->magic == MH_MAGIC)
-#else
+#else
if (((struct mach_header *)module)->magic == MH_CIGAM)
-#endif
+#endif
{
if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage)
{
mh=module;
- if (ltdl_NSIsSymbolNameDefinedInImage((struct mach_header*)module,symbol))
+ if (ltdl_NSIsSymbolNameDefinedInImage((struct mach_header*)module,symbol))
{
nssym = ltdl_NSLookupSymbolInImage((struct mach_header*)module,
symbol,
- NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW
+ NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW
| NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR
);
}
- }
-
- }
+ }
+
+ }
else {
nssym = NSLookupSymbolInModule(module, symbol);
}
- if (!nssym)
+ if (!nssym)
{
if (!mh) mh=lt_int_dyld_get_mach_header_from_nsmodule(module);
nssym = lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh);
- }
- if (!nssym)
+ }
+ if (!nssym)
{
LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(SYMBOL_NOT_FOUND)));
return NULL;
- }
+ }
return NSAddressOfSymbol(nssym);
}