Skip to content

Commit

Permalink
batman-adv-legacy: update symbols from "batadv_" to "batadv_legacy_"
Browse files Browse the repository at this point in the history
Signed-off-by: Linus Lüssing <[email protected]>
  • Loading branch information
T-X committed Nov 27, 2018
1 parent 07293d6 commit a7bbf2f
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ ifeq ($(shell cd $(KERNELPATH) && pwd),)
$(warning $(KERNELPATH) is missing, please set KERNELPATH)
endif

OBJCOPY ?= objcopy
OBJDUMP ?= objdump

export KERNELPATH
RM ?= rm -f

Expand All @@ -49,11 +52,21 @@ ccflags-y += -DBATADV_SOURCE_VERSION=\"$(REVISION)\"
endif
include $(PWD)/Makefile.kbuild

all: config
all: build updatesyms

build: config
$(MAKE) -C $(KERNELPATH) M=$(PWD) PWD=$(PWD) modules

updatesyms:
@if ! $(OBJDUMP) -j .init.text -t batman-adv-legacy.ko| grep -q "batadv_legacy_init"; then \
$(OBJDUMP) -t batman-adv-legacy.ko | grep batadv_ | grep -v "batadv_legacy" | \
sed "s/.* \([^ ]*\)batadv_\([^ ]*\)$$/\1batadv_\2 \1batadv_legacy_\2/" \
>> $(PWD)/updated-syms.txt; \
$(OBJCOPY) --redefine-syms=$(PWD)/updated-syms.txt $(PWD)/batman-adv-legacy.ko; \
fi

clean:
$(RM) compat-autoconf.h*
$(RM) compat-autoconf.h* updated-syms.txt
$(MAKE) -C $(KERNELPATH) M=$(PWD) PWD=$(PWD) clean

install: config
Expand All @@ -63,4 +76,4 @@ install: config
config:
$(PWD)/gen-compat-autoconf.sh $(PWD)/compat-autoconf.h

.PHONY: all clean install config
.PHONY: all build updatesyms clean install config

0 comments on commit a7bbf2f

Please sign in to comment.