From: Tom Lane Date: Tue, 1 Oct 2002 05:06:44 +0000 (+0000) Subject: Pass less-unsafe parameters to Darwin's NSLinkModule. While this change prevents... X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=7b86d9ff9c65e70a802f4ea54d74be5a056a47d1;p=users%2Fbernd%2Fpostgres.git 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. --- diff --git a/src/backend/port/dynloader/darwin.c b/src/backend/port/dynloader/darwin.c index 721ecb2893..7aecab922f 100644 --- a/src/backend/port/dynloader/darwin.c +++ b/src/backend/port/dynloader/darwin.c @@ -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