Skip to contentSkip to conversation

build: also exclude .data.rel.ro in $(cmd_obj_init_o)

PATCH In review Jan Beulich 2 participants 2 messages Sep 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: also exclude .data.rel.ro in $(cmd_obj_init_o)

.data.rel.ro really is merely a special case of .rodata: r/o data, but with runtime relocations (not relevant to Xen), i.e. r/o only after relocations were performed (by the dynamic loader).

---
.*.local did already cover gcc's use of .data.rel.ro.local, but doesn't cover Clang using e.g. .data.rel.ro..Lswitch.table.<function>.

Beyond exclusion being similarly (slightly) fragile as that of .rodata, there's an extra naming issue here: A writable file scope variable named "ro" with an initializer taking the address of another identifier would, with -fdata-sections and -fpic, be put in .data.rel.ro by gcc (Clang uses .data.ro irrespective of -fpic). See also
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127240.

xen/Rules.mk +1 -1
@@ -263,7 +263,7 @@ quiet_cmd_obj_init_o = INIT_O  $@
 define cmd_obj_init_o
     $(OBJDUMP) -h $< | while read idx name sz rest; do \
         case "$$name" in \
-        .*.local) ;; \
+        .*.local|.data.rel.ro|.data.rel.ro.*) ;; \
         .text|.text.*|.data|.data.*|.bss|.bss.*) \
             test $$(echo $$sz | sed 's,00*,0,') != 0 || continue; \
             echo "Error: size of $<:$$name is 0x$$sz" >&2; \