]> xenbits.xensource.com Git - livepatch-build-tools.git/commitdiff
Bundle .data.rel.ro. and .data.rel.ro.local. sections
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Fri, 13 Nov 2015 08:27:02 +0000 (08:27 +0000)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 20 Jan 2016 13:48:25 +0000 (13:48 +0000)
.data.rel.ro(.local). sections are (local) read only data sections with
relocations.

For example:
static const struct hvm_mmio_handler *const
hvm_mmio_handlers[HVM_MMIO_HANDLER_NR] =
{
    &hpet_mmio_handler,
    &vlapic_mmio_handler,
    &vioapic_mmio_handler,
    &msixtbl_mmio_handler,
    &iommu_mmio_handler
};

Allow these sections to be bundled so that section symbols can be
replaced with normal symbols, preventing them from being needlessly
included.

common.c

index bed6b5f82a48375a0ed728bb8a6a189885d661cd..5efaec898fb505fc327276956c127e12a8a9891e 100644 (file)
--- a/common.c
+++ b/common.c
@@ -133,6 +133,16 @@ static int is_bundleable(struct symbol *sym)
           !strcmp(sym->sec->name + 6, sym->name))
                return 1;
 
+       if (sym->type == STT_OBJECT &&
+          !strncmp(sym->sec->name, ".data.rel.ro.", 13) &&
+          !strcmp(sym->sec->name + 13, sym->name))
+               return 1;
+
+       if (sym->type == STT_OBJECT &&
+          !strncmp(sym->sec->name, ".data.rel.ro.local.", 19) &&
+          !strcmp(sym->sec->name + 19, sym->name))
+               return 1;
+
        if (sym->type == STT_OBJECT &&
           !strncmp(sym->sec->name, ".rodata.",8) &&
           !strcmp(sym->sec->name + 8, sym->name))