summaryrefslogtreecommitdiff
path: root/util/cbfstool/Makefile.inc
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2014-03-07 15:11:53 -0600
committerAaron Durbin <adurbin@google.com>2014-03-20 21:34:39 +0100
commit4fde5a66b4a2b4117a45519ab0f63a9fd6bff835 (patch)
treefc69dd7a4833805f274d8a5ea89ac34065e3921d /util/cbfstool/Makefile.inc
parent36be8135d74964fa2eb03af44079d845c199486b (diff)
util: add rmodtool for parsing ELF files to rmodules
The current implementation of creating rmodules relies on invoking the linker in a certain manner with the relocations overlaid on the BSS section. It's not really surprising that the linker doesn't always behave the way one wants depending on the linker used and the architecture. Instead, introduce rmodtool which takes an ELF file as an input, parses it, and creates a new ELF file in the format the rmodule loader expects. Change-Id: I31ac2d327d450ef841c3a7d9740b787278382bef Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5378 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'util/cbfstool/Makefile.inc')
-rw-r--r--util/cbfstool/Makefile.inc22
1 files changed, 16 insertions, 6 deletions
diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc
index c19b7d9070..2923938ab7 100644
--- a/util/cbfstool/Makefile.inc
+++ b/util/cbfstool/Makefile.inc
@@ -17,10 +17,16 @@ cbfsobj += LzmaEnc.o
cbfsobj += linux_trampoline.o
cbfsobj += cbfs-payload-linux.o
-CBFSTOOLFLAGS= -g
+rmodobj += rmodtool.o
+rmodobj += rmodule.o
+rmodobj += common.o
+rmodobj += elfheaders.o
+rmodobj += xdr.o
+
+TOOLFLAGS= -g
ifeq ($(shell uname -s | cut -c-7 2>/dev/null), MINGW32)
-CBFSTOOLFLAGS+=-mno-ms-bitfields
+TOOLFLAGS+=-mno-ms-bitfields
endif
$(objutil)/cbfstool:
@@ -28,17 +34,21 @@ $(objutil)/cbfstool:
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/%.c
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
- $(HOSTCC) $(CBFSTOOLFLAGS) $(HOSTCFLAGS) -c -o $@ $<
+ $(HOSTCC) $(TOOLFLAGS) $(HOSTCFLAGS) -c -o $@ $<
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/%.c
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
- $(HOSTCC) $(CBFSTOOLFLAGS) $(HOSTCFLAGS) -c -o $@ $<
+ $(HOSTCC) $(TOOLFLAGS) $(HOSTCFLAGS) -c -o $@ $<
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/%.c
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
- $(HOSTCC) $(CBFSTOOLFLAGS) $(HOSTCFLAGS) -c -o $@ $<
+ $(HOSTCC) $(TOOLFLAGS) $(HOSTCFLAGS) -c -o $@ $<
$(objutil)/cbfstool/cbfstool: $(objutil)/cbfstool $(addprefix $(objutil)/cbfstool/,$(cbfsobj))
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
- $(HOSTCC) $(CBFSTOOLFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cbfsobj))
+ $(HOSTCC) $(TOOLFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cbfsobj))
+
+$(objutil)/cbfstool/rmodtool: $(objutil)/cbfstool $(addprefix $(objutil)/cbfstool/,$(rmodobj))
+ printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
+ $(HOSTCC) $(TOOLFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(rmodobj))