From 361f1e165628b8dd6fbb379a792cc49b35a760dc Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 1 Oct 2002 05:06:44 +0000 Subject: [PATCH] Pass less-unsafe parameters to Darwin's NSLinkModule. While this change prevents a backend coredump when loading a broken shlib, it also seems to suppress the error messages that might help debug the problem :-(. Perhaps someone would like to supply a 'linkEdit' hook to get the best of both worlds. But in the meantime, backend crash trumps error reporting. --- src/backend/port/dynloader/darwin.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/port/dynloader/darwin.c b/src/backend/port/dynloader/darwin.c index 9f95d4011f..5d1aa757ce 100644 --- a/src/backend/port/dynloader/darwin.c +++ b/src/backend/port/dynloader/darwin.c @@ -3,7 +3,7 @@ * available with a PostgreSQL-compatible license. Kudos Wilfredo * Sánchez . * - * $Header: /cvsroot/pgsql/src/backend/port/dynloader/darwin.c,v 1.5 2001/03/22 03:59:42 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/port/dynloader/darwin.c,v 1.6 2002/10/01 05:06:44 tgl Exp $ */ #include "postgres.h" @@ -18,7 +18,9 @@ pg_dlopen(char *filename) if (NSCreateObjectFileImageFromFile(filename, &image) != NSObjectFileImageSuccess) return NULL; - return NSLinkModule(image, filename, TRUE); + return NSLinkModule(image, filename, + NSLINKMODULE_OPTION_BINDNOW | + NSLINKMODULE_OPTION_RETURN_ON_ERROR); } void