public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Fix GenSec GCC make failure
@ 2017-12-05 13:54 Yonghong Zhu
  2017-12-05 14:14 ` Leif Lindholm
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Yonghong Zhu @ 2017-12-05 13:54 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao, Leif Lindholm

It is a regression bug introduced by the patch b37b108, it cause GenSec
make failure on GCC Env.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/C/GenSec/GenSec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
index 2b2def1..5545f12 100644
--- a/BaseTools/Source/C/GenSec/GenSec.c
+++ b/BaseTools/Source/C/GenSec/GenSec.c
@@ -1324,11 +1324,11 @@ Returns:
       // Open file and read contents
       //
       DummyFile = fopen (LongFilePath (DummyFileName), "rb");
       if (DummyFile == NULL) {
         Error (NULL, 0, 0001, "Error opening file", DummyFileName);
-        return EFI_ABORTED;
+        goto Finish;
       }
 
       fseek (DummyFile, 0, SEEK_END);
       DummyFileSize = ftell (DummyFile);
       fseek (DummyFile, 0, SEEK_SET);
@@ -1338,22 +1338,22 @@ Returns:
       DebugMsg (NULL, 0, 9, "Dummy files", "the dummy file name is %s and the size is %u bytes", DummyFileName, (unsigned) DummyFileSize);
 
       InFile = fopen(LongFilePath(InputFileName[0]), "rb");
       if (InFile == NULL) {
         Error (NULL, 0, 0001, "Error opening file", InputFileName[0]);
-        return EFI_ABORTED;
+        goto Finish;
       }
 
       fseek (InFile, 0, SEEK_END);
       InFileSize = ftell (InFile);
       fseek (InFile, 0, SEEK_SET);
       InFileBuffer = (UINT8 *) malloc (InFileSize);
       fread(InFileBuffer, 1, InFileSize, InFile);
       fclose(InFile);
       DebugMsg (NULL, 0, 9, "Input files", "the input file name is %s and the size is %u bytes", InputFileName[0], (unsigned) InFileSize);
       if (InFileSize > DummyFileSize){
-        if (stricmp(DummyFileBuffer, InFileBuffer + (InFileSize - DummyFileSize)) == 0){
+        if (stricmp((CHAR8 *)DummyFileBuffer, (CHAR8 *)(InFileBuffer + (InFileSize - DummyFileSize))) == 0){
           SectGuidHeaderLength = InFileSize - DummyFileSize;
         }
       }
       if (SectGuidHeaderLength == 0) {
         SectGuidAttribute |= EFI_GUIDED_SECTION_PROCESSING_REQUIRED;
-- 
2.6.1.windows.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Patch] BaseTools: Fix GenSec GCC make failure
  2017-12-05 13:54 [Patch] BaseTools: Fix GenSec GCC make failure Yonghong Zhu
@ 2017-12-05 14:14 ` Leif Lindholm
  2017-12-05 14:50   ` Leif Lindholm
  2017-12-05 14:58 ` Gao, Liming
  2017-12-05 18:19 ` Laszlo Ersek
  2 siblings, 1 reply; 6+ messages in thread
From: Leif Lindholm @ 2017-12-05 14:14 UTC (permalink / raw)
  To: Yonghong Zhu; +Cc: edk2-devel, Liming Gao

On Tue, Dec 05, 2017 at 09:54:59PM +0800, Yonghong Zhu wrote:
> It is a regression bug introduced by the patch b37b108, it cause GenSec
> make failure on GCC Env.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>

I can confirm this resolves my issue - pick either or both of:
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

Thanks!

> ---
>  BaseTools/Source/C/GenSec/GenSec.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
> index 2b2def1..5545f12 100644
> --- a/BaseTools/Source/C/GenSec/GenSec.c
> +++ b/BaseTools/Source/C/GenSec/GenSec.c
> @@ -1324,11 +1324,11 @@ Returns:
>        // Open file and read contents
>        //
>        DummyFile = fopen (LongFilePath (DummyFileName), "rb");
>        if (DummyFile == NULL) {
>          Error (NULL, 0, 0001, "Error opening file", DummyFileName);
> -        return EFI_ABORTED;
> +        goto Finish;
>        }
>  
>        fseek (DummyFile, 0, SEEK_END);
>        DummyFileSize = ftell (DummyFile);
>        fseek (DummyFile, 0, SEEK_SET);
> @@ -1338,22 +1338,22 @@ Returns:
>        DebugMsg (NULL, 0, 9, "Dummy files", "the dummy file name is %s and the size is %u bytes", DummyFileName, (unsigned) DummyFileSize);
>  
>        InFile = fopen(LongFilePath(InputFileName[0]), "rb");
>        if (InFile == NULL) {
>          Error (NULL, 0, 0001, "Error opening file", InputFileName[0]);
> -        return EFI_ABORTED;
> +        goto Finish;
>        }
>  
>        fseek (InFile, 0, SEEK_END);
>        InFileSize = ftell (InFile);
>        fseek (InFile, 0, SEEK_SET);
>        InFileBuffer = (UINT8 *) malloc (InFileSize);
>        fread(InFileBuffer, 1, InFileSize, InFile);
>        fclose(InFile);
>        DebugMsg (NULL, 0, 9, "Input files", "the input file name is %s and the size is %u bytes", InputFileName[0], (unsigned) InFileSize);
>        if (InFileSize > DummyFileSize){
> -        if (stricmp(DummyFileBuffer, InFileBuffer + (InFileSize - DummyFileSize)) == 0){
> +        if (stricmp((CHAR8 *)DummyFileBuffer, (CHAR8 *)(InFileBuffer + (InFileSize - DummyFileSize))) == 0){
>            SectGuidHeaderLength = InFileSize - DummyFileSize;
>          }
>        }
>        if (SectGuidHeaderLength == 0) {
>          SectGuidAttribute |= EFI_GUIDED_SECTION_PROCESSING_REQUIRED;
> -- 
> 2.6.1.windows.1
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch] BaseTools: Fix GenSec GCC make failure
  2017-12-05 14:14 ` Leif Lindholm
@ 2017-12-05 14:50   ` Leif Lindholm
  2017-12-05 14:58     ` Gao, Liming
  0 siblings, 1 reply; 6+ messages in thread
From: Leif Lindholm @ 2017-12-05 14:50 UTC (permalink / raw)
  To: Yonghong Zhu; +Cc: edk2-devel, Liming Gao

On Tue, Dec 05, 2017 at 02:14:26PM +0000, Leif Lindholm wrote:
> On Tue, Dec 05, 2017 at 09:54:59PM +0800, Yonghong Zhu wrote:
> > It is a regression bug introduced by the patch b37b108, it cause GenSec
> > make failure on GCC Env.
> > 
> > Cc: Liming Gao <liming.gao@intel.com>
> > Cc: Leif Lindholm <leif.lindholm@linaro.org>
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> 
> I can confirm this resolves my issue - pick either or both of:
> Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

Although thinking about it, it would still make sense for the
ENCODE_ERROR macro in BaseTools/Source/C/Include/Common/BaseTypes.h to
mimic the one in MdePkg/Include/Base.h:

diff --git a/BaseTools/Source/C/Include/Common/BaseTypes.h
b/BaseTools/Source/C/Include/Common/BaseTypes.h
index 198647ab95..5fa4e560d8 100644
--- a/BaseTools/Source/C/Include/Common/BaseTypes.h
+++ b/BaseTools/Source/C/Include/Common/BaseTypes.h
@@ -170,12 +170,12 @@
 // EFI Error Codes common to all execution phases
  //

-typedef INTN RETURN_STATUS;
+typedef UINTN RETURN_STATUS;

 ///
 /// Set the upper bit to indicate EFI Error.
 ///
-#define ENCODE_ERROR(a)              (MAX_BIT | (a))
+#define ENCODE_ERROR(a)              ((RETURN_STATUS)(MAX_BIT | (a)))

 #define ENCODE_WARNING(a)            (a)
 #define RETURN_ERROR(a)              ((a) < 0)
  

Should I send this as a separate patch?

/
    Leif

> Thanks!
> 
> > ---
> >  BaseTools/Source/C/GenSec/GenSec.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
> > index 2b2def1..5545f12 100644
> > --- a/BaseTools/Source/C/GenSec/GenSec.c
> > +++ b/BaseTools/Source/C/GenSec/GenSec.c
> > @@ -1324,11 +1324,11 @@ Returns:
> >        // Open file and read contents
> >        //
> >        DummyFile = fopen (LongFilePath (DummyFileName), "rb");
> >        if (DummyFile == NULL) {
> >          Error (NULL, 0, 0001, "Error opening file", DummyFileName);
> > -        return EFI_ABORTED;
> > +        goto Finish;
> >        }
> >  
> >        fseek (DummyFile, 0, SEEK_END);
> >        DummyFileSize = ftell (DummyFile);
> >        fseek (DummyFile, 0, SEEK_SET);
> > @@ -1338,22 +1338,22 @@ Returns:
> >        DebugMsg (NULL, 0, 9, "Dummy files", "the dummy file name is %s and the size is %u bytes", DummyFileName, (unsigned) DummyFileSize);
> >  
> >        InFile = fopen(LongFilePath(InputFileName[0]), "rb");
> >        if (InFile == NULL) {
> >          Error (NULL, 0, 0001, "Error opening file", InputFileName[0]);
> > -        return EFI_ABORTED;
> > +        goto Finish;
> >        }
> >  
> >        fseek (InFile, 0, SEEK_END);
> >        InFileSize = ftell (InFile);
> >        fseek (InFile, 0, SEEK_SET);
> >        InFileBuffer = (UINT8 *) malloc (InFileSize);
> >        fread(InFileBuffer, 1, InFileSize, InFile);
> >        fclose(InFile);
> >        DebugMsg (NULL, 0, 9, "Input files", "the input file name is %s and the size is %u bytes", InputFileName[0], (unsigned) InFileSize);
> >        if (InFileSize > DummyFileSize){
> > -        if (stricmp(DummyFileBuffer, InFileBuffer + (InFileSize - DummyFileSize)) == 0){
> > +        if (stricmp((CHAR8 *)DummyFileBuffer, (CHAR8 *)(InFileBuffer + (InFileSize - DummyFileSize))) == 0){
> >            SectGuidHeaderLength = InFileSize - DummyFileSize;
> >          }
> >        }
> >        if (SectGuidHeaderLength == 0) {
> >          SectGuidAttribute |= EFI_GUIDED_SECTION_PROCESSING_REQUIRED;
> > -- 
> > 2.6.1.windows.1
> > 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Patch] BaseTools: Fix GenSec GCC make failure
  2017-12-05 14:50   ` Leif Lindholm
@ 2017-12-05 14:58     ` Gao, Liming
  0 siblings, 0 replies; 6+ messages in thread
From: Gao, Liming @ 2017-12-05 14:58 UTC (permalink / raw)
  To: Leif Lindholm, Zhu, Yonghong; +Cc: edk2-devel@lists.01.org

Leif:
  I suggest to create another patch for it. 

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Leif Lindholm
> Sent: Tuesday, December 5, 2017 10:51 PM
> To: Zhu, Yonghong <yonghong.zhu@intel.com>
> Cc: edk2-devel@lists.01.org; Gao, Liming <liming.gao@intel.com>
> Subject: Re: [edk2] [Patch] BaseTools: Fix GenSec GCC make failure
> 
> On Tue, Dec 05, 2017 at 02:14:26PM +0000, Leif Lindholm wrote:
> > On Tue, Dec 05, 2017 at 09:54:59PM +0800, Yonghong Zhu wrote:
> > > It is a regression bug introduced by the patch b37b108, it cause GenSec
> > > make failure on GCC Env.
> > >
> > > Cc: Liming Gao <liming.gao@intel.com>
> > > Cc: Leif Lindholm <leif.lindholm@linaro.org>
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> >
> > I can confirm this resolves my issue - pick either or both of:
> > Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
> > Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
> 
> Although thinking about it, it would still make sense for the
> ENCODE_ERROR macro in BaseTools/Source/C/Include/Common/BaseTypes.h to
> mimic the one in MdePkg/Include/Base.h:
> 
> diff --git a/BaseTools/Source/C/Include/Common/BaseTypes.h
> b/BaseTools/Source/C/Include/Common/BaseTypes.h
> index 198647ab95..5fa4e560d8 100644
> --- a/BaseTools/Source/C/Include/Common/BaseTypes.h
> +++ b/BaseTools/Source/C/Include/Common/BaseTypes.h
> @@ -170,12 +170,12 @@
>  // EFI Error Codes common to all execution phases
>   //
> 
> -typedef INTN RETURN_STATUS;
> +typedef UINTN RETURN_STATUS;
> 
>  ///
>  /// Set the upper bit to indicate EFI Error.
>  ///
> -#define ENCODE_ERROR(a)              (MAX_BIT | (a))
> +#define ENCODE_ERROR(a)              ((RETURN_STATUS)(MAX_BIT | (a)))
> 
>  #define ENCODE_WARNING(a)            (a)
>  #define RETURN_ERROR(a)              ((a) < 0)
> 
> 
> Should I send this as a separate patch?
> 
> /
>     Leif
> 
> > Thanks!
> >
> > > ---
> > >  BaseTools/Source/C/GenSec/GenSec.c | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
> > > index 2b2def1..5545f12 100644
> > > --- a/BaseTools/Source/C/GenSec/GenSec.c
> > > +++ b/BaseTools/Source/C/GenSec/GenSec.c
> > > @@ -1324,11 +1324,11 @@ Returns:
> > >        // Open file and read contents
> > >        //
> > >        DummyFile = fopen (LongFilePath (DummyFileName), "rb");
> > >        if (DummyFile == NULL) {
> > >          Error (NULL, 0, 0001, "Error opening file", DummyFileName);
> > > -        return EFI_ABORTED;
> > > +        goto Finish;
> > >        }
> > >
> > >        fseek (DummyFile, 0, SEEK_END);
> > >        DummyFileSize = ftell (DummyFile);
> > >        fseek (DummyFile, 0, SEEK_SET);
> > > @@ -1338,22 +1338,22 @@ Returns:
> > >        DebugMsg (NULL, 0, 9, "Dummy files", "the dummy file name is %s and the size is %u bytes", DummyFileName, (unsigned)
> DummyFileSize);
> > >
> > >        InFile = fopen(LongFilePath(InputFileName[0]), "rb");
> > >        if (InFile == NULL) {
> > >          Error (NULL, 0, 0001, "Error opening file", InputFileName[0]);
> > > -        return EFI_ABORTED;
> > > +        goto Finish;
> > >        }
> > >
> > >        fseek (InFile, 0, SEEK_END);
> > >        InFileSize = ftell (InFile);
> > >        fseek (InFile, 0, SEEK_SET);
> > >        InFileBuffer = (UINT8 *) malloc (InFileSize);
> > >        fread(InFileBuffer, 1, InFileSize, InFile);
> > >        fclose(InFile);
> > >        DebugMsg (NULL, 0, 9, "Input files", "the input file name is %s and the size is %u bytes", InputFileName[0], (unsigned)
> InFileSize);
> > >        if (InFileSize > DummyFileSize){
> > > -        if (stricmp(DummyFileBuffer, InFileBuffer + (InFileSize - DummyFileSize)) == 0){
> > > +        if (stricmp((CHAR8 *)DummyFileBuffer, (CHAR8 *)(InFileBuffer + (InFileSize - DummyFileSize))) == 0){
> > >            SectGuidHeaderLength = InFileSize - DummyFileSize;
> > >          }
> > >        }
> > >        if (SectGuidHeaderLength == 0) {
> > >          SectGuidAttribute |= EFI_GUIDED_SECTION_PROCESSING_REQUIRED;
> > > --
> > > 2.6.1.windows.1
> > >
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch] BaseTools: Fix GenSec GCC make failure
  2017-12-05 13:54 [Patch] BaseTools: Fix GenSec GCC make failure Yonghong Zhu
  2017-12-05 14:14 ` Leif Lindholm
@ 2017-12-05 14:58 ` Gao, Liming
  2017-12-05 18:19 ` Laszlo Ersek
  2 siblings, 0 replies; 6+ messages in thread
From: Gao, Liming @ 2017-12-05 14:58 UTC (permalink / raw)
  To: Zhu, Yonghong, edk2-devel@lists.01.org; +Cc: Leif Lindholm

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yonghong Zhu
> Sent: Tuesday, December 5, 2017 9:55 PM
> To: edk2-devel@lists.01.org
> Cc: Leif Lindholm <leif.lindholm@linaro.org>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [Patch] BaseTools: Fix GenSec GCC make failure
> 
> It is a regression bug introduced by the patch b37b108, it cause GenSec
> make failure on GCC Env.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
>  BaseTools/Source/C/GenSec/GenSec.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
> index 2b2def1..5545f12 100644
> --- a/BaseTools/Source/C/GenSec/GenSec.c
> +++ b/BaseTools/Source/C/GenSec/GenSec.c
> @@ -1324,11 +1324,11 @@ Returns:
>        // Open file and read contents
>        //
>        DummyFile = fopen (LongFilePath (DummyFileName), "rb");
>        if (DummyFile == NULL) {
>          Error (NULL, 0, 0001, "Error opening file", DummyFileName);
> -        return EFI_ABORTED;
> +        goto Finish;
>        }
> 
>        fseek (DummyFile, 0, SEEK_END);
>        DummyFileSize = ftell (DummyFile);
>        fseek (DummyFile, 0, SEEK_SET);
> @@ -1338,22 +1338,22 @@ Returns:
>        DebugMsg (NULL, 0, 9, "Dummy files", "the dummy file name is %s and the size is %u bytes", DummyFileName, (unsigned)
> DummyFileSize);
> 
>        InFile = fopen(LongFilePath(InputFileName[0]), "rb");
>        if (InFile == NULL) {
>          Error (NULL, 0, 0001, "Error opening file", InputFileName[0]);
> -        return EFI_ABORTED;
> +        goto Finish;
>        }
> 
>        fseek (InFile, 0, SEEK_END);
>        InFileSize = ftell (InFile);
>        fseek (InFile, 0, SEEK_SET);
>        InFileBuffer = (UINT8 *) malloc (InFileSize);
>        fread(InFileBuffer, 1, InFileSize, InFile);
>        fclose(InFile);
>        DebugMsg (NULL, 0, 9, "Input files", "the input file name is %s and the size is %u bytes", InputFileName[0], (unsigned)
> InFileSize);
>        if (InFileSize > DummyFileSize){
> -        if (stricmp(DummyFileBuffer, InFileBuffer + (InFileSize - DummyFileSize)) == 0){
> +        if (stricmp((CHAR8 *)DummyFileBuffer, (CHAR8 *)(InFileBuffer + (InFileSize - DummyFileSize))) == 0){
>            SectGuidHeaderLength = InFileSize - DummyFileSize;
>          }
>        }
>        if (SectGuidHeaderLength == 0) {
>          SectGuidAttribute |= EFI_GUIDED_SECTION_PROCESSING_REQUIRED;
> --
> 2.6.1.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch] BaseTools: Fix GenSec GCC make failure
  2017-12-05 13:54 [Patch] BaseTools: Fix GenSec GCC make failure Yonghong Zhu
  2017-12-05 14:14 ` Leif Lindholm
  2017-12-05 14:58 ` Gao, Liming
@ 2017-12-05 18:19 ` Laszlo Ersek
  2 siblings, 0 replies; 6+ messages in thread
From: Laszlo Ersek @ 2017-12-05 18:19 UTC (permalink / raw)
  To: Yonghong Zhu, edk2-devel; +Cc: Leif Lindholm, Liming Gao

On 12/05/17 14:54, Yonghong Zhu wrote:
> It is a regression bug introduced by the patch b37b108, it cause GenSec
> make failure on GCC Env.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
>  BaseTools/Source/C/GenSec/GenSec.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c
> index 2b2def1..5545f12 100644
> --- a/BaseTools/Source/C/GenSec/GenSec.c
> +++ b/BaseTools/Source/C/GenSec/GenSec.c
> @@ -1324,11 +1324,11 @@ Returns:
>        // Open file and read contents
>        //
>        DummyFile = fopen (LongFilePath (DummyFileName), "rb");
>        if (DummyFile == NULL) {
>          Error (NULL, 0, 0001, "Error opening file", DummyFileName);
> -        return EFI_ABORTED;
> +        goto Finish;
>        }
>  
>        fseek (DummyFile, 0, SEEK_END);
>        DummyFileSize = ftell (DummyFile);
>        fseek (DummyFile, 0, SEEK_SET);
> @@ -1338,22 +1338,22 @@ Returns:
>        DebugMsg (NULL, 0, 9, "Dummy files", "the dummy file name is %s and the size is %u bytes", DummyFileName, (unsigned) DummyFileSize);
>  
>        InFile = fopen(LongFilePath(InputFileName[0]), "rb");
>        if (InFile == NULL) {
>          Error (NULL, 0, 0001, "Error opening file", InputFileName[0]);
> -        return EFI_ABORTED;
> +        goto Finish;
>        }
>  
>        fseek (InFile, 0, SEEK_END);
>        InFileSize = ftell (InFile);
>        fseek (InFile, 0, SEEK_SET);
>        InFileBuffer = (UINT8 *) malloc (InFileSize);
>        fread(InFileBuffer, 1, InFileSize, InFile);
>        fclose(InFile);
>        DebugMsg (NULL, 0, 9, "Input files", "the input file name is %s and the size is %u bytes", InputFileName[0], (unsigned) InFileSize);
>        if (InFileSize > DummyFileSize){
> -        if (stricmp(DummyFileBuffer, InFileBuffer + (InFileSize - DummyFileSize)) == 0){
> +        if (stricmp((CHAR8 *)DummyFileBuffer, (CHAR8 *)(InFileBuffer + (InFileSize - DummyFileSize))) == 0){
>            SectGuidHeaderLength = InFileSize - DummyFileSize;
>          }
>        }
>        if (SectGuidHeaderLength == 0) {
>          SectGuidAttribute |= EFI_GUIDED_SECTION_PROCESSING_REQUIRED;
> 

Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-05 18:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-05 13:54 [Patch] BaseTools: Fix GenSec GCC make failure Yonghong Zhu
2017-12-05 14:14 ` Leif Lindholm
2017-12-05 14:50   ` Leif Lindholm
2017-12-05 14:58     ` Gao, Liming
2017-12-05 14:58 ` Gao, Liming
2017-12-05 18:19 ` Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox