From 038720e899594c4775c30d1cb6ee6c5dc13237df Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Sat, 6 Jan 2018 20:24:11 +0100 Subject: [PATCH] ShellPkg/UefiShellLevel2CommandsLib: add missing EFIAPI call conv spec UefiShellLevel2CommandsLib (somewhat questionably) calls the BaseLib-internal function InternalCharToUpper(). This function is declared in "MdePkg/Library/BaseLib/BaseLibInternals.h", which is not a public library class header. UefiShellLevel2CommandsLib therefore duplicates the function declaration, but a mistake was made: the EFIAPI calling convention is not spelled out on the duplicated declaration. Therefore calls made from UefiShellLevel2CommandsLib will not match the actual function definition in "MdePkg/Library/BaseLib/String.c", when GCC/X64 toolchains are used. One consequence of this is that cross-filesystem copies don't work in the UEFI shell (see the StrniCmp() function in "UefiShellLevel2CommandsLib.c"). From the original report: > FS0:\efi\ubuntu\> cp grubx64.efi fs1:\ > > cp: The source and destination are the same. Copy the declaration from "BaseLibInternals.h" to "UefiShellLevel2CommandsLib.c" verbatim. Reported-by: Rebecca Cran Analyzed-by: Thomas Palmer Analyzed-by: Liming Gao Ref: http://mid.mail-archive.com/47cd17d8-f022-6ca5-2f52-06a8250f8d14@cran.org.uk Cc: Jaben Carsey Cc: Liming Gao Cc: Rebecca Cran Cc: Ruiyu Ni Cc: Thomas Palmer Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Thomas Palmer Reviewed-by: Jaben Carsey --- .../UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c index 7948e53cfc..e9ce631892 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c @@ -268,8 +268,9 @@ VerifyIntermediateDirectories ( @return Char as an upper case character. **/ CHAR16 +EFIAPI InternalCharToUpper ( - IN CONST CHAR16 Char + IN CHAR16 Char ); /**