[PATCH v3 5/7] mkimage: refactor a bunch of section data into a struct.

2018-02-21 Thread Peter Jones
This basically moves a bunch of the section information we pass around a lot into a struct, and passes a pointer to a single one of those instead. Because it's more convenient, it also puts the section_vaddresses calculations in locate_section(), which no longer returns the allocation for section_

[PATCH v3 3/7] mkimage: rename a couple of things to be less confusing later.

2018-02-21 Thread Peter Jones
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

[PATCH v3 7/7] .mod files: Strip annobin annotations and .eh_frame, and their relocations

2018-02-21 Thread Peter Jones
This way debuginfo built from the .module will still include this information, but the final result won't have the data we don't actually need in the modules, either on-disk, loaded at runtime, or in prebuilt images. Signed-off-by: Peter Jones --- grub-core/genmod.sh.in | 4 1 file changed,

[PATCH v3 4/7] mkimage: make locate_sections() set up vaddresses as well.

2018-02-21 Thread Peter Jones
This puts both kinds of address initialization at the same place, and also lets us iterate through the section list one time fewer. Signed-off-by: Peter Jones --- util/grub-mkimagexx.c | 49 - 1 file changed, 24 insertions(+), 25 deletions(-) diff

[PATCH v3 2/7] mkimage: make it easier to run syntax checkers on grub-mkimagexx.c

2018-02-21 Thread Peter Jones
This makes it so you can treat grub-mkimagexx.c as a file you can build directly, so syntax checkers like vim's "syntastic" plugin, which uses "gcc -x c -fsyntax-only" to build it, will work. One still has to do whatever setup is required to make it pick the right include dirs, which -W options we

[PATCH v3 6/7] mkimage: avoid copying relocations for sections that won't be copied.

2018-02-21 Thread Peter Jones
Some versions of gcc include a plugin called "annobin", and in some build systems this is enabled by default. This plugin creates special ELF note sections to track which ABI-breaking features are used by a binary, as well as a series of relocations to annotate where. If grub is compiled with thi

[PATCH v3 1/7] aout.h: Fix missing include.

2018-02-21 Thread Peter Jones
grub_aout_load() has a grub_file_t parameter, and depending on what order includes land in, it's sometimes not defined. This patch explicitly adds file.h to aout.h so that it will always be defined. Signed-off-by: Peter Jones --- include/grub/aout.h | 1 + 1 file changed, 1 insertion(+) diff -

Re: [PATCH v2 1/3] mkimage: refactor a bunch of section data into a struct.

2018-02-21 Thread Peter Jones
On Wed, Feb 21, 2018 at 12:07:42PM +0100, Daniel Kiper wrote: > This change does not seem to be logical part of this patch. Okay, I've rolled all these things up into my local tree, get ready for another volley of patches. This version starts with 2 patches that are only vaguely related, that are

Re: [PATCH v2 2/3] mkimage: avoid copying relocations for sections that won't be copied.

2018-02-21 Thread Daniel Kiper
On Tue, Feb 20, 2018 at 06:25:32PM -0500, Peter Jones wrote: > Some versions of gcc include a plugin called "annobin", and in some > build systems this is enabled by default. This plugin creates special > ELF note sections to track which ABI-breaking features are used by a > binary, as well as a s

Re: [PATCH v2 3/3] .mod files: Strip annobin annotations and .eh_frame, and their relocations

2018-02-21 Thread Daniel Kiper
On Tue, Feb 20, 2018 at 06:25:33PM -0500, Peter Jones wrote: > This way debuginfo built from the .module will still include this > information, but the final result won't have the data we don't actually > need in the modules, either on-disk, loaded at runtime, or in prebuilt > images. > > Signed-of

Re: [PATCH v2 1/3] mkimage: refactor a bunch of section data into a struct.

2018-02-21 Thread Daniel Kiper
On Tue, Feb 20, 2018 at 06:25:31PM -0500, Peter Jones wrote: > This basically moves a bunch of the section information we pass around a > lot into a struct, and passes a pointer to a single one of those > instead. > > Because it's more convenient, it also puts the section_vaddresses > calculations