]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
build: Fix notes
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 4 Feb 2022 17:01:03 +0000 (17:01 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 7 Feb 2022 11:25:56 +0000 (11:25 +0000)
Notes worked largely by chance.  Give the note section a proper ELF type, and
add a program header to capture the notes section too.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/link.lds.S
include/xtf/asm_macros.h

index f7356dd31f8a9474921ad144f5835dab8dbda5c9..4daee1c4e5a127f0c79c56e518f2afab1497276d 100644 (file)
@@ -26,8 +26,8 @@ ENTRY(_elf_start)
 
 PHDRS
 {
-        /* Single loadable section, RWE. */
-        load PT_LOAD FLAGS(7);
+        text PT_LOAD FLAGS(7); /* RWE */
+        note PT_NOTE FLAGS(4); /* R   */
 }
 
 SECTIONS
@@ -45,7 +45,7 @@ SECTIONS
        . = ALIGN(PAGE_SIZE);
         __end_user_text = .;
 
-        } :load = 0
+        } :text = 0
 
         .data : {
                 *(.data)
@@ -60,6 +60,11 @@ SECTIONS
 
         }
 
+        .note : {
+                *(.note)
+                *(.note.*)
+        } :note :text
+
         .rodata : {
                 *(.rodata)
                 *(.rodata.*)
@@ -68,12 +73,7 @@ SECTIONS
         __start_ex_table = .;
                 *(.ex_table)
         __stop_ex_table = .;
-        }
-
-        .note : {
-                *(.note)
-                *(.note.*)
-        }
+        } :text
 
         .bss : {
                 *(.bss)
index c5313555ee007adc9fd63f9f1751b5690fa4d830..feb8ca3f2320f7c359c67ee430bb81cd8645679d 100644 (file)
@@ -62,7 +62,7 @@ name:
  * 'desc' may be an arbitrary asm construct.
  */
 #define ELFNOTE(name, type, desc)                   \
-    .pushsection .note.name                       ; \
+    .pushsection .note.name, "a", @note           ; \
     .align 4                                      ; \
     .long 2f - 1f         /* namesz */            ; \
     .long 4f - 3f         /* descsz */            ; \
@@ -76,7 +76,7 @@ name:
 #else
 
 #define ELFNOTE(name, type, desc)                \
-    asm (".pushsection .note." #name ";"         \
+    asm (".pushsection .note, \"a\", @note;"     \
     ".align 4;"                                  \
     ".long 2f - 1f;"       /* namesz */          \
     ".long 4f - 3f;"       /* descsz */          \