Received: from list by lists.gnu.org with archive (Exim 4.71) id 1eoauW-0006A3-O8 for mharc-grub-devel@gnu.org; Wed, 21 Feb 2018 15:22:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eoatW-0005xc-5T for grub-devel@gnu.org; Wed, 21 Feb 2018 15:22:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eoasW-0003NG-Bq for grub-devel@gnu.org; Wed, 21 Feb 2018 15:21:38 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58230 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eoasV-0003MK-Ht for grub-devel@gnu.org; Wed, 21 Feb 2018 15:20:36 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2559940FB639; Wed, 21 Feb 2018 20:20:35 +0000 (UTC) Received: from trillian.uncooperative.org.com (dhcp-10-20-1-221.bss.redhat.com [10.20.1.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0134910A971E; Wed, 21 Feb 2018 20:20:34 +0000 (UTC) From: Peter Jones To: grub-devel@gnu.org Cc: Daniel Kiper , Peter Jones Subject: [PATCH v3 3/7] mkimage: rename a couple of things to be less confusing later. Date: Wed, 21 Feb 2018 15:20:25 -0500 Message-Id: <20180221202029.31419-3-pjones@redhat.com> In-Reply-To: <20180221202029.31419-1-pjones@redhat.com> References: <20180221201833.prjf4yvfldjltptp@redhat.com> <20180221202029.31419-1-pjones@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 21 Feb 2018 20:20:35 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 21 Feb 2018 20:20:35 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pjones@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Feb 2018 20:22:39 -0000 This renames some things: - the "strtab" and "strtab_section" in relocate_symbols are changed to "symtab" instead, so as to be less confusing when "strtab" is moved to a struct in a later patch. - The places where we pass section_vaddresses to functions are changed to also be called section_vaddresses"inside those functions, so I get less confused when I put addresses and vaddresses in a struct in a later patch. Signed-off-by: Peter Jones --- util/grub-mkimagexx.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index 10d7b41e3bf..e00a831e0ca 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -509,7 +509,7 @@ SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc Return the address of a start symbol. */ static Elf_Addr SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, - Elf_Shdr *symtab_section, Elf_Addr *section_addresses, + Elf_Shdr *symtab_section, Elf_Addr *section_vaddresses, Elf_Half section_entsize, Elf_Half num_sections, void *jumpers, Elf_Addr jumpers_addr, Elf_Addr bss_start, Elf_Addr end, @@ -520,15 +520,15 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Addr start_address = (Elf_Addr) -1; Elf_Sym *sym; Elf_Word i; - Elf_Shdr *strtab_section; - const char *strtab; + Elf_Shdr *symtab_link_section; + const char *symtab; grub_uint64_t *jptr = jumpers; - strtab_section + symtab_link_section = (Elf_Shdr *) ((char *) sections + (grub_target_to_host32 (symtab_section->sh_link) * section_entsize)); - strtab = (char *) e + grub_target_to_host (strtab_section->sh_offset); + symtab = (char *) e + grub_target_to_host (symtab_link_section->sh_offset); symtab_size = grub_target_to_host (symtab_section->sh_size); sym_size = grub_target_to_host (symtab_section->sh_entsize); @@ -542,7 +542,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Section cur_index; const char *name; - name = strtab + grub_target_to_host32 (sym->st_name); + name = symtab + grub_target_to_host32 (sym->st_name); cur_index = grub_target_to_host16 (sym->st_shndx); if (cur_index == STN_ABS) @@ -565,7 +565,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, else { sym->st_value = (grub_target_to_host (sym->st_value) - + section_addresses[cur_index]); + + section_vaddresses[cur_index]); } if (image_target->elf_target == EM_IA_64 && ELF_ST_TYPE (sym->st_info) @@ -580,7 +580,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, grub_util_info ("locating %s at 0x%" GRUB_HOST_PRIxLONG_LONG " (0x%" GRUB_HOST_PRIxLONG_LONG ")", name, (unsigned long long) sym->st_value, - (unsigned long long) section_addresses[cur_index]); + (unsigned long long) section_vaddresses[cur_index]); if (start_address == (Elf_Addr)-1) if (strcmp (name, "_start") == 0 || strcmp (name, "start") == 0) @@ -1643,7 +1643,7 @@ create_u64_fixups (struct translate_context *ctx, /* Make a .reloc section. */ static void make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, - Elf_Addr *section_addresses, Elf_Shdr *sections, + Elf_Addr *section_vaddresses, Elf_Shdr *sections, Elf_Half section_entsize, Elf_Half num_sections, const char *strtab, const struct grub_install_image_target_desc *image_target) @@ -1673,7 +1673,7 @@ make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, rtab_offset = grub_target_to_host (s->sh_offset); num_rs = rtab_size / r_size; - section_address = section_addresses[grub_le_to_cpu32 (s->sh_info)]; + section_address = section_vaddresses[grub_le_to_cpu32 (s->sh_info)]; for (j = 0, r = (Elf_Rel *) ((char *) e + rtab_offset); j < num_rs; -- 2.15.0