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);
}