[OpenBIOS] [PATCH] a.out header copy

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Mon Feb 10 02:26:54 CET 2014


On 09/02/14 21:56, Olivier Danet wrote:

> Right, there is no need to seek backwards to pick the a.out header on
> disk, as it is already loaded in memory.
>
> Simpler :
>
> Index: libopenbios/aout_load.c
> ===================================================================
> --- libopenbios/aout_load.c (révision 1257)
> +++ libopenbios/aout_load.c (copie de travail)
> @@ -9,6 +9,9 @@
> #ifdef CONFIG_SPARC64
> #define CONFIG_SPARC64_PAGE_SIZE_8KB
> #endif
> +#ifdef CONFIG_SPARC32
> +#define AOUT_HEADER_COPY
> +#endif
>
> #include "libopenbios/sys_info.h"
> #include "libopenbios/bindings.h"
> @@ -140,6 +143,10 @@
> }
> }
>
> +#ifdef AOUT_HEADER_COPY
> + // Copy the a.out header just before the start
> + memcpy((char *)(start-0x20), &ehdr, 0x20);
> +#endif
> debug("Loaded %lu bytes\n", size);
> debug("entry point is %#lx\n", start);
>
> ===================================================================

Yes, this looks better to me. If you don't mind, I'll tweak the 
comment/commit message and apply it over the next few days.


ATB,

Mark.



More information about the OpenBIOS mailing list