@@ -54,6 +54,7 @@ xen_hello_world.o: config.h livepatch_depends.h
$(LIVEPATCH): xen_hello_world_func.o xen_hello_world.o
$(LD) $(LDFLAGS) $(build_id_linker) -r -o $(LIVEPATCH) $^
$(OBJCOPY) --strip-debug --strip-symbol=$(NOTE_SYMBOL) $@
+ $(OBJCOPY) --set-section-flags .livepatch.funcs=alloc,readonly $@
#
# This target is only accessible if CONFIG_LIVEPATCH is defined, which
@@ -90,6 +91,7 @@ xen_bye_world.o: config.h hello_world_livepatch_depends.h
$(LIVEPATCH_BYE): xen_bye_world_func.o xen_bye_world.o
$(LD) $(LDFLAGS) $(build_id_linker) -r -o $(LIVEPATCH_BYE) $^
$(OBJCOPY) --strip-debug --strip-symbol=$(NOTE_SYMBOL) $@
+ $(OBJCOPY) --set-section-flags .livepatch.funcs=alloc,readonly $@
xen_replace_world.o: config.h livepatch_depends.h
@@ -97,6 +99,7 @@ xen_replace_world.o: config.h livepatch_depends.h
$(LIVEPATCH_REPLACE): xen_replace_world_func.o xen_replace_world.o
$(LD) $(LDFLAGS) $(build_id_linker) -r -o $(LIVEPATCH_REPLACE) $^
$(OBJCOPY) --strip-debug --strip-symbol=$(NOTE_SYMBOL) $@
+ $(OBJCOPY) --set-section-flags .livepatch.funcs=alloc,readonly $@
xen_nop.o: config.h livepatch_depends.h
@@ -104,6 +107,7 @@ xen_nop.o: config.h livepatch_depends.h
$(LIVEPATCH_NOP): xen_nop.o
$(LD) $(LDFLAGS) $(build_id_linker) -r -o $(LIVEPATCH_NOP) $^
$(OBJCOPY) --strip-debug --strip-symbol=$(NOTE_SYMBOL) $@
+ $(OBJCOPY) --set-section-flags .livepatch.funcs=alloc,readonly $@
.PHONY: livepatch
livepatch: $(LIVEPATCH) $(LIVEPATCH_BYE) $(LIVEPATCH_REPLACE) $(LIVEPATCH_NOP)
Instead of being writable (.data). This mimics the behavior of what livepatch-build-tools do. Other approaches such as 'struct const livepatch_funcs' still result in the WA section attributes. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- xen/test/livepatch/Makefile | 4 ++++ 1 file changed, 4 insertions(+)