[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v4 16/16] livepatch: In xen_nop test-case remove the .bss and .data sections



As they are not needed for the livepatch to work.

Also this allows us to properly test:
"livepatch: Disallow applying after an revert" as the livepatch
will now only have the minimalistic sections:

Section Headers:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  [ 0]                   NULL             0000000000000000  00000000
       0000000000000000  0000000000000000           0     0     0
  [ 1] .note.gnu.build-i NOTE             0000000000000000  00000040
       0000000000000024  0000000000000000   A       0     0     4
  [ 2] .text             PROGBITS         0000000000000024  00000064
       0000000000000000  0000000000000000  AX       0     0     4
  [ 3] .livepatch.depend PROGBITS         0000000000000000  00000064
       0000000000000024  0000000000000000   A       0     0     1
  [ 4] .livepatch.funcs  PROGBITS         0000000000000000  000000a0
       0000000000000040  0000000000000000  WA       0     0     32
  [ 5] .note.GNU-stack   PROGBITS         0000000000000000  000000e0
       0000000000000000  0000000000000000   X       0     0     1
  [ 6] .comment          PROGBITS         0000000000000000  000000e0
       000000000000002d  0000000000000001  MS       0     0     1
  [ 7] .shstrtab         STRTAB           0000000000000000  0000010d
       0000000000000071  0000000000000000           0     0     1
  [ 8] .symtab           SYMTAB           0000000000000000  00000400
       00000000000000c0  0000000000000018           9     7     8
  [ 9] .strtab           STRTAB           0000000000000000  000004c0
       000000000000000f  0000000000000000           0     0     1

In which only .livepatch.funcs is write-able.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

v4: New submission
---
 xen/test/livepatch/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/test/livepatch/Makefile b/xen/test/livepatch/Makefile
index d7a4735..41ad59d 100644
--- a/xen/test/livepatch/Makefile
+++ b/xen/test/livepatch/Makefile
@@ -104,6 +104,8 @@ xen_nop.o: config.h
 .PHONY: $(LIVEPATCH_NOP)
 $(LIVEPATCH_NOP): xen_nop.o note.o
        $(LD) $(LDFLAGS) $(build_id_linker) -r -o $(LIVEPATCH_NOP) $^
+       $(OBJCOPY) --remove-section=.bss --remove-section=.data $@
+       $(OBJCOPY) --strip-unneeded $@
 
 .PHONY: livepatch
 livepatch: $(LIVEPATCH) $(LIVEPATCH_BYE) $(LIVEPATCH_REPLACE) $(LIVEPATCH_NOP)
-- 
2.5.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.