On Saturday 18 September 2010 13:35:18 Olaf Siejka wrote:
> Thanks. If you dont mind, i will open a bug repor for you and post your
> finidings there. If you have anything else, please let me know if i can
> assist.
>
> Best regards

Hello Olaf,

do what you think is a best for ReactOS development.

It worth to test, that this problem appears
in your/others builds as well. The check is simple

i586-mingw32-objdump --headers xxx.sys

I have examined drivers in regular ReactOS Rbuild
output before initial report and situation is same
as for my driver hacking.

If regular ReactOS developers finds same situation
for their builds, then some action should be taken.

My quick Google search reveals, that ".rdata" are
used by regular windows drivers.

I have checked Windows 2k installation (WINNT/system32/drivers/*.sys)
a there are even some more section tagged by  IMAGE_SCN_MEM_NOT_PAGED

 .data, .rdata, .rdata, .rsrc, .text

and even sections

 init, _LDATA, NONPAGE, page, SECUR

but these I consider as little strange.

But I think, that .rdata and may it be .rsrc should
be added in pefixup tool.

I have tried to replace my MS WDF driver build with ReactOS
driver build on real Windows, but have not luck wit that.
So there is some other problem as well.
I try to manage somehow to test my ReactOS driver build
in ReactOS, but I need to find time to overcome some other
blockers - USB, or use PCI card on real HW. But that is
for other thread.

Best wishes,

            Pavel


> 2010/9/18 Pavel Pisa <[email protected]>
>
> > Hello all,
> >
> > I have noticed, that pxefixup does not set IMAGE_SCN_MEM_NOT_PAGED flag
> > for read-only data section ".rdata". May it be, that it is problem
> > for my own build of tools
> >
> > 586-mingw32-gcc (GCC) 4.4.2 and
> > GNU ld (GNU Binutils) 2.20.51.20100608
> >
> > I have fixed the problem by preparing modified LD script version
> > which collect object files .rdata section into .text section
> > for my driver build.
> >
> > But .rdata is legitimate section and it is automatically
> > generated by GCC. I have not found information in Wiki
> > or list archives, that there is some way/patch to deal
> > with this situation. But if it is allowed, that WDM
> > driver binaries contains readonly section then data paging
> > could lead to horrible consequences. Possible fix
> >
> >
> > diff --git a/reactos/tools/pefixup.c b/reactos/tools/pefixup.c
> > index f908a9a..d6ec1f4 100644
> > --- a/reactos/tools/pefixup.c
> > +++ b/reactos/tools/pefixup.c
> > @@ -381,6 +381,7 @@ int main(int argc, char **argv)
> >          if (!strcmp((char*)section_header->Name, ".text") ||
> >              !strcmp((char*)section_header->Name, ".data") ||
> >              !strcmp((char*)section_header->Name, ".idata") ||
> > +             !strcmp((char*)section_header->Name, ".rdata") ||
> >              !strcmp((char*)section_header->Name, ".bss"))
> >          {
> >             section_header->Characteristics |=
> > htodl(IMAGE_SCN_MEM_NOT_PAGED);
> >
> > If .rdata are not allowed or should be used only for pseudo_reloc,
> > then the ldscript for kernel code should be provided.
> >
> >
> > Missing flag for .rdata section in objdump ouput
> >
> > $ i586-mingw32-objdump --headers ul_wdm.sys
> > BFD: ul_wdm.sys: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED
> > in section .text
> > BFD: ul_wdm.sys: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED
> > in section .data
> > BFD: ul_wdm.sys: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED
> > in section .bss
> > BFD: ul_wdm.sys: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED
> > in section .idata
> >
> > ul_wdm.sys:     file format pei-i386
> >
> > Sections:
> > Idx Name          Size      VMA               LMA               File off
> >  Algn
> >  0 .text         0000cabc  00011000  00011000  00001000  2**2
> >                  CONTENTS, ALLOC, LOAD, READONLY, CODE
> >  1 .data         000000e8  0001e000  0001e000  0000e000  2**2
> >                  CONTENTS, ALLOC, LOAD, DATA
> >  2 .rdata        00003c20  0001f000  0001f000  0000f000  2**2
> >                  CONTENTS, ALLOC, LOAD, READONLY, DATA
> >  3 .bss          00000050  00023000  00023000  00000000  2**2
> >                  ALLOC
> >  4 .edata        00000033  00024000  00024000  00013000  2**2
> >                  CONTENTS, ALLOC, LOAD, READONLY, DATA
> >  5 .idata        000008c4  00025000  00025000  00014000  2**2
> >                  CONTENTS, ALLOC, LOAD, DATA
> >  6 .rsrc         0000035c  00026000  00026000  00015000  2**2
> >                  CONTENTS, ALLOC, LOAD, DATA
> >  7 .reloc        00000cd4  00027000  00027000  00016000  2**2
> >                  CONTENTS, ALLOC, LOAD, READONLY, DATA
> >  8 .rossym       0001576d  00028000  00028000  00017000  2**2
> >                  CONTENTS, READONLY, NEVER_LOAD, EXCLUDE
> >
> > _______________________________________________
> > Ros-dev mailing list
> > [email protected]
> > http://www.reactos.org/mailman/listinfo/ros-dev



_______________________________________________
Ros-dev mailing list
[email protected]
http://www.reactos.org/mailman/listinfo/ros-dev

Reply via email to