From e557a34aeabad05a1ba37afb078f79b287631458 Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Fri, 13 Nov 2015 08:27:02 +0000 Subject: [PATCH] Bundle .data.rel.ro. and .data.rel.ro.local. sections .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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common.c b/common.c index bed6b5f..5efaec8 100644 --- 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)) -- 2.39.5