vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| quand j'utilise ldd sur un executable ou un .so je ne peux plus faire de strip, ou ecraser le fichier le fichier est occupé, je ne peux que le supprimer cp unprog monprog ldd monprog overwrite monprog? y cp: monprog: Text file busy strip monprog strip: monprog -- 0654-400 Cannot open file. Text file busy Si quelqu'un a une idée, merci d'avance.. Patrice j'utilise ldd-1.0 : /* * %W% revision of %E% %U% * This is an unpublished work copyright (c) 1993 HELIOS Software GmbH * 30827 Garbsen, Germany */ /* * ldd.c - List dynamic dependencies. Performs a similar function as the * SunOS or System V.4 ldd command. This one works by loading the * target program through load() and then printing all loaded * modules as returned by loadquery(). * * To compile: * xlc -D_ALL_SOURCE -o ldd -O ldd.c -bnoso -bI:/usr/lib/syscalls.exp */ /* * Distribution rights verified with HELIOS in March 2002 by AIXPDSLIB * (aixpdslib.seas.ucla.edu): * * From: helmut@helios.de (Helmut Tschemernjak) * To: mats@aixpdslib.seas.ucla.edu * Cc: jim@ugraf.com * Subject: Re: Fw: ldd for aix license * Date: Sat, 9 Mar 2002 22:31:30 +0100 * * * Dear Mats Rynge, * * It is ok to publish this source code freely. * * best regards / mit freundlichen Gruessen, * * Helmut Tschemernjak * * * HELIOS Software GmbH * Steinriede 3 * 30827 Garbsen * Phone: +49-5131-709320 * Fax: +49-5131-709325 * Internet Mail: helmut@helios.de * Internet Web: http://www.helios.de * * */ #include <stdio.h> #include <errno.h> #include <string.h> #include <stdlib.h> #include <sys/types.h> #include <sys/ldr.h> void errxit(char *); int main(int argc, char **argv) { struct ld_info *lp; char *buf; int size = 4*1024; int i; if (argc != 2) { fprintf(stderr, "Usage: %s program\n", argv[0]); exit(1); } if (load(argv[1], 0, NULL) == NULL) { char *buffer[1024]; /* if (errno != ENOEXEC) errxit(argv[1]); */ buffer[0] = "execerror"; buffer[1] = argv[1]; loadquery(L_GETMESSAGES, &buffer[2], sizeof(buffer)-8); execvp("/usr/sbin/execerror", buffer); errxit("execerror"); } if ((buf = malloc(size)) == NULL) errxit("malloc"); while ((i = loadquery(L_GETINFO, buf, size)) == -1 && errno == ENOMEM) { free(buf); size += 4*1024; if ((buf = malloc(size)) == NULL) errxit("malloc"); } if (i == -1) errxit("loadquery"); lp = (struct ld_info *)buf; while (lp) { /* * Skip over ourselves. The main part is always the first * in the list of loaded modules. */ if (lp != (struct ld_info *)buf) { char *fileName = lp->ldinfo_filename; char *memberName = fileName + strlen(fileName) + 1; printf("%s", fileName); if (*memberName) printf("(%s)", memberName); printf("\n"); } if (lp->ldinfo_next == 0) lp = NULL; else lp = (struct ld_info *)((char *)lp + lp->ldinfo_next); } free(buf); return 0; } void errxit(char *s) { perror(s); exit(1); } |
| |||
| Patrice wrote: > quand j'utilise ldd sur un executable ou un .so > je ne peux plus faire de strip, ou ecraser le fichier > le fichier est occupé, je ne peux que le supprimer You may get a better answer if you ask in English. The "ldd" you attached "load"s the exe or .so as if it was a shared library. Now, it is a well known (mis)feature of AIX: shared libraries are "sticky" -- they are (by default) loaded into a shared memory segment, and stay there, until the system is rebooted or "slibclean" is run. [This is a nice optimization for production systems -- it makes subsequent loading much faster, but it is a misfeature for development systems]. The "canonical" way to prevent this behaviour is "chmod o-rwx exe" -- since the exe can't be read by "others", it will be loaded into private segment instead of the shared one, and will not be sticky anymore. Cheers, |
| ||||
| Thank you very much. I understood Patrice TPaul Pluzhnikov wrote: > Patrice wrote: > >> quand j'utilise ldd sur un executable ou un .so >> je ne peux plus faire de strip, ou ecraser le fichier >> le fichier est occupé, je ne peux que le supprimer > > > You may get a better answer if you ask in English. > > The "ldd" you attached "load"s the exe or .so as if it was a shared > library. Now, it is a well known (mis)feature of AIX: shared libraries > are "sticky" -- they are (by default) loaded into a shared memory > segment, and stay there, until the system is rebooted or "slibclean" is > run. [This is a nice optimization for production systems -- it makes > subsequent loading much faster, but it is a misfeature for development > systems]. > > The "canonical" way to prevent this behaviour is "chmod o-rwx exe" -- > since the exe can't be read by "others", it will be loaded into private > segment instead of the shared one, and will not be sticky anymore. > > Cheers, > |