[PATCH 1/5] Fix size of external_reloc for pe-aarch64

Jan Beulich jbeulich@suse.com
Fri Dec 16 07:03:51 GMT 2022


On 16.12.2022 03:13, Mark Harmstone wrote:
> This patch series finishes off the work by Jedidiah Thompson, and adds
> support for creating aarch64 PE images.
> 
> This should be essentially complete: I've used this to create a "hello
> world" Windows program in asm, and (with GCC patches) a UEFI program in
> C. I think the only things missing are the .secidx relocation, which is
> needed for PDBs, and the SEH pseudos used for C++ exceptions.
> 
> This first patch fixes the size of RELSZ; I'm not sure why it was 14 in
> the first place. This is the size of the "Base Relocation Block" in
> https://learn.microsoft.com/en-us/windows/win32/debug/pe-format, and
> AFAIK should be 10 for everything.

Not sure - there look to be different formats in use, judging from other
headers in include/coff/. See e.g. arm.h which even has two forms.
Clearly in the original commit (b69c9d41e894), targeting only objcopy
(and maybe objdump) for PE binaries, this didn't really matter. Does it
actually matter for you, when you're also only targeting PE? Or are you
(in spite of the title) really after COFF objects as well?

Let me Cc Tamar, the author of the original patch, to possibly shed
some more light on what the struct was initially derived from.

Jan


More information about the Binutils mailing list