summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-01-13 10:14:25 +0200
committerPanu Matilainen <pmatilai@redhat.com>2011-01-13 10:14:25 +0200
commitfe68483d1b341416f28caa894d8392681d827868 (patch)
treeb4366ee310e32bbfd59e53493bc55a012fa39864 /tools
parent9f3a0debb686485312d184d7a8c8aad49978629f (diff)
downloadrpm-fe68483d1b341416f28caa894d8392681d827868.tar.gz
Add switch to allow printing only soname dependencies to elfdeps helper
Diffstat (limited to 'tools')
-rw-r--r--tools/elfdeps.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/elfdeps.c b/tools/elfdeps.c
index 7482a5e76..b52369895 100644
--- a/tools/elfdeps.c
+++ b/tools/elfdeps.c
@@ -13,6 +13,7 @@
#include <rpm/argv.h>
int filter_private = 0;
+int soname_only = 0;
typedef struct elfInfo_s {
Elf *elf;
@@ -65,7 +66,7 @@ static void processVerDef(Elf_Scn *scn, GElf_Shdr *shdr, elfInfo *ei)
soname = rstrdup(s);
auxoffset += aux->vda_next;
continue;
- } else if (soname && !skipPrivate(s)) {
+ } else if (soname && !soname_only && !skipPrivate(s)) {
const char *marker = ei->isElf64 ? "(64bit)" : "";
char *dep = NULL;
rasprintf(&dep, "%s(%s)%s", soname, s, marker);
@@ -108,7 +109,7 @@ static void processVerNeed(Elf_Scn *scn, GElf_Shdr *shdr, elfInfo *ei)
if (s == NULL)
break;
- if (ei->isExec && soname && !skipPrivate(s)) {
+ if (ei->isExec && soname && !soname_only && !skipPrivate(s)) {
const char *marker = ei->isElf64 ? "(64bit)" : "";
char *dep = NULL;
rasprintf(&dep, "%s(%s)%s", soname, s, marker);
@@ -234,7 +235,7 @@ static int processFile(const char *fn, int dtype)
* For DSOs which use the .gnu_hash section and don't have a .hash
* section, we need to ensure that we have a new enough glibc.
*/
- if (ei->isExec && ei->gotGNUHASH && !ei->gotHASH) {
+ if (ei->isExec && ei->gotGNUHASH && !ei->gotHASH && !soname_only) {
argvAdd(&ei->requires, "rtld(GNU_HASH)");
}
@@ -277,6 +278,7 @@ int main(int argc, char *argv[])
{ "provides", 'P', POPT_ARG_VAL, &provides, -1, NULL, NULL },
{ "requires", 'R', POPT_ARG_VAL, &requires, -1, NULL, NULL },
{ "filter-private", 0, POPT_ARG_VAL, &filter_private, -1, NULL, NULL },
+ { "soname-only", 0, POPT_ARG_VAL, &soname_only, -1, NULL, NULL },
POPT_AUTOHELP
POPT_TABLEEND
};