]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
tests/x86emul: Annotate test blobs as executable code
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 24 May 2019 15:14:53 +0000 (16:14 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 6 Aug 2019 10:32:08 +0000 (11:32 +0100)
This causes objdump to disassemble them, rather than rendering them as
straight hex data.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
tools/tests/x86_emulator/Makefile

index a3a65556b6d3c23cbccb1a153975056ebe4e3ac9..b9312e004491bff0b740db2452ec094cce3ee242 100644 (file)
@@ -191,7 +191,10 @@ $(addsuffix .h,$(TESTCASES)): %.h: %.c testcase.mk Makefile
                (echo 'static const unsigned int __attribute__((section(".test, \"ax\", @progbits #")))' \
                      "$${prefix}_$(arch)$${flavor}[] = {"; \
                 od -v -t x $*.bin | sed -e 's/^[0-9]* /0x/' -e 's/ /, 0x/g' -e 's/$$/,/'; \
-                echo "};") >>$@.new; \
+                echo "};"; \
+                echo "asm(\".type $${prefix}_$(arch)$${flavor}, STT_NOTYPE;\");"; \
+                echo "asm(\".type $${prefix}_$(arch)$${flavor}, STT_FUNC;\");"; \
+               ) >>$@.new; \
                rm -f $*.bin; \
            done; \
        )
@@ -207,7 +210,10 @@ $(addsuffix -opmask.h,$(OPMASK)): %.h: opmask.S testcase.mk Makefile
                (echo 'static const unsigned int __attribute__((section(".test, \"ax\", @progbits #")))' \
                      "$${prefix}_$(arch)$${flavor}[] = {"; \
                 od -v -t x $*.bin | sed -e 's/^[0-9]* /0x/' -e 's/ /, 0x/g' -e 's/$$/,/'; \
-                echo "};") >>$@.new; \
+                echo "};"; \
+                echo "asm(\".type $${prefix}_$(arch)$${flavor}, STT_NOTYPE;\");"; \
+                echo "asm(\".type $${prefix}_$(arch)$${flavor}, STT_FUNC;\");"; \
+               ) >>$@.new; \
                rm -f $*.bin; \
            done; \
        )