aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Robinson <andr345@gmail.com>2009-05-10 11:31:58 +0200
committerAndreas Robinson <andr345@gmail.com>2009-05-12 12:55:40 +0200
commit90822ab233d2bbd347bdfaac4be407e924dbd5ae (patch)
tree23bd8bf0208a03968f1577677a98c0292879d259
parent5af0c0f484bde37beb80313a339ea53fcab6b8a7 (diff)
downloadmodule-init-tools-90822ab233d2bbd347bdfaac4be407e924dbd5ae.tar.gz
moduleops: rename to elfops and move to static lib
Signed-off-by: Andreas Robinson <andr345@gmail.com>
-rw-r--r--Makefile.am12
-rw-r--r--depmod.c2
-rw-r--r--elfops.c (renamed from moduleops.c)6
-rw-r--r--elfops.h (renamed from moduleops.h)0
-rw-r--r--elfops_core.c (renamed from moduleops_core.c)8
5 files changed, 14 insertions, 14 deletions
diff --git a/Makefile.am b/Makefile.am
index e5bb4c7..d319446 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,8 +4,8 @@ insmod_SOURCES = insmod.c testing.h
lsmod_SOURCES = lsmod.c testing.h
modprobe_SOURCES = modprobe.c zlibsupport.c zlibsupport.h testing.h
rmmod_SOURCES = rmmod.c testing.h
-depmod_SOURCES = depmod.c zlibsupport.c moduleops.c tables.c \
- zlibsupport.h moduleops.h tables.h testing.h
+depmod_SOURCES = depmod.c zlibsupport.c tables.c \
+ zlibsupport.h tables.h testing.h
modinfo_SOURCES = modinfo.c zlibsupport.c zlibsupport.h testing.h
modindex_SOURCES = modindex.c zlibsupport.c zlibsupport.h testing.h
@@ -19,14 +19,14 @@ EXTRA_lsmod_SOURCES =
EXTRA_modprobe_SOURCES =
EXTRA_rmmod_SOURCES =
EXTRA_insmod_static_SOURCES =
-EXTRA_depmod_SOURCES = moduleops_core.c
+EXTRA_depmod_SOURCES =
EXTRA_modinfo_SOURCES =
-libmodtools_a_SOURCES = util.c logging.c index.c config_filter.c \
- util.h depmod.h logging.h index.h list.h config_filter.h
+libmodtools_a_SOURCES = util.c logging.c index.c config_filter.c elfops.c \
+ util.h depmod.h logging.h index.h list.h config_filter.h elfops.h
libmodtools_a_CFLAGS = -ffunction-sections
-EXTRA_libmodtools_a_SOURCES = elf_core.c
+EXTRA_libmodtools_a_SOURCES = elf_core.c elfops_core.c
insmod_LDADD = $(LDADD) libmodtools.a
lsmod_LDADD = $(LDADD) libmodtools.a
diff --git a/depmod.c b/depmod.c
index 93e3833..a7bd948 100644
--- a/depmod.c
+++ b/depmod.c
@@ -26,7 +26,7 @@
#include "depmod.h"
#include "logging.h"
#include "index.h"
-#include "moduleops.h"
+#include "elfops.h"
#include "tables.h"
#include "config_filter.h"
diff --git a/moduleops.c b/elfops.c
index 1ee52be..e9d74ef 100644
--- a/moduleops.c
+++ b/elfops.c
@@ -8,13 +8,13 @@
#include "depmod.h"
#include "util.h"
#include "logging.h"
-#include "moduleops.h"
+#include "elfops.h"
#include "tables.h"
#define PERBIT(x) x##32
#define ElfPERBIT(x) Elf32_##x
#define ELFPERBIT(x) ELF32_##x
-#include "moduleops_core.c"
+#include "elfops_core.c"
#undef PERBIT
#undef ElfPERBIT
@@ -22,4 +22,4 @@
#define PERBIT(x) x##64
#define ElfPERBIT(x) Elf64_##x
#define ELFPERBIT(x) ELF64_##x
-#include "moduleops_core.c"
+#include "elfops_core.c"
diff --git a/moduleops.h b/elfops.h
index dd74432..dd74432 100644
--- a/moduleops.h
+++ b/elfops.h
diff --git a/moduleops_core.c b/elfops_core.c
index e2440d7..4649b3f 100644
--- a/moduleops_core.c
+++ b/elfops_core.c
@@ -136,7 +136,7 @@ static void *PERBIT(deref_sym)(ElfPERBIT(Ehdr) *hdr,
* recent GCC versions. */
if (END(sechdrs[END(sym->st_shndx, conv)].sh_type,conv) == SHT_NOBITS)
return NULL;
-
+
if (secsize)
*secsize = END(sym->st_size, conv);
return (void *)hdr
@@ -155,7 +155,7 @@ static void PERBIT(fetch_tables)(struct elf_file *module,
ElfPERBIT(Sym) *syms;
ElfPERBIT(Shdr) *sechdrs;
int conv;
-
+
hdr = module->data;
conv = module->conv;
@@ -166,7 +166,7 @@ static void PERBIT(fetch_tables)(struct elf_file *module,
/* Don't warn again: we already have above */
if (!strings || !syms)
return;
-
+
tables->pci_table = NULL;
tables->usb_table = NULL;
tables->ccw_table = NULL;
@@ -179,7 +179,7 @@ static void PERBIT(fetch_tables)(struct elf_file *module,
for (i = 0; i < size / sizeof(syms[0]); i++) {
char *name = strings + END(syms[i].st_name, conv);
-
+
if (!tables->pci_table && streq(name, "__mod_pci_device_table")) {
tables->pci_size = PERBIT(PCI_DEVICE_SIZE);
tables->pci_table = PERBIT(deref_sym)(hdr, sechdrs, &syms[i],