Re: [RFC-v4] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior)

Pedro Alves
2012-12-07T17:50:50Z

Please don't top post.

On 12/07/2012 05:03 PM, Pierre Muller wrote:
> Hi Pedro,
>
> The values are indeed included in include/coff/pe.h header...
> The problem is that coff-pe-read.c was
> written completely without the use of this
> header.
> Using that header would probably be better,
> but would also require even more rewrite
> of current code...
>
> I tried nevertheless to include coff/pe.h
> I got an error about AOUTHDR not being defined,
> which requires adding coff/external.h
> but if I add that one, I get another error
> that L_LNNO_SIZE must be defined...
> And that one is defined in cpu specific files
> coff/CPU.h
>
> This seems to mean that including pe.h is not that easy :(

Yuck. It'd be nice if the architecture independent
bits of pe.h were split into a separate file, e.g.,
pe-common.h. But I'll agree that this should not be a
requirement for this patch.

But I'm still confused on why do you need "#ifndef IMAGE_SCN_CNT_CODE"
instead of unconditionally defining the constants. What is pulling
a header that defines these?

--
Pedro Alves