Reviewed-by: Liming Gao <[email protected]>

> -----邮件原件-----
> 发件人: Mikhail Krichanov <[email protected]>
> 发送时间: 2021年12月8日 18:05
> 收件人: [email protected]
> 抄送: Bob Feng <[email protected]>; Liming Gao
> <[email protected]>; Yuwei Chen <[email protected]>; Vitaly
> Cheptsov <[email protected]>; Mikhail Krichanov
> <[email protected]>
> 主题: [PATCH] BaseTools: Fix for NOOPT CLANG38 compilation with clang-13
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3715
> REF CI: https://github.com/tianocore/edk2/pull/2241
> 
> We must treat not only R_X86_64_PLT32 as R_X86_64_PC32
> (https://github.com/torvalds/linux/commit/
> b21ebf2fb4cde1618915a97cc773e287ff49173e),
> but also treat R_386_PLT32 relocation as R_386_PC32
> (https://github.com/torvalds/linux/commit/
> bb73d07148c405c293e576b40af37737faf23a6a).
> 
> Cc: Bob Feng <[email protected]>
> Cc: Liming Gao <[email protected]>
> Cc: Yuwei Chen <[email protected]>
> Cc: Vitaly Cheptsov <[email protected]>
> Signed-off-by: Mikhail Krichanov <[email protected]>
> ---
>  BaseTools/Source/C/GenFw/Elf32Convert.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/C/GenFw/Elf32Convert.c
> b/BaseTools/Source/C/GenFw/Elf32Convert.c
> index d917a444c8..b785998492 100644
> --- a/BaseTools/Source/C/GenFw/Elf32Convert.c
> +++ b/BaseTools/Source/C/GenFw/Elf32Convert.c
> @@ -779,6 +779,7 @@ WriteSections32 (
>              *(UINT32 *)Targ = *(UINT32 *)Targ - SymShdr->sh_addr
>                + mCoffSectionsOffset[Sym->st_shndx];
>              break;
> +          case R_386_PLT32:
>            case R_386_PC32:
>              //
>              // Relative relocation: Symbol - Ip + Addend
> @@ -900,6 +901,7 @@ WriteRelocations32 (
>            if (mEhdr->e_machine == EM_386) {
>              switch (ELF_R_TYPE(Rel->r_info)) {
>              case R_386_NONE:
> +            case R_386_PLT32:
>              case R_386_PC32:
>                //
>                // No fixup entry required.
> @@ -1168,5 +1170,3 @@ CleanUp32 (
>      free (mCoffSectionsOffset);
>    }
>  }
> -
> -
> --
> 2.20.1




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#84851): https://edk2.groups.io/g/devel/message/84851
Mute This Topic: https://groups.io/mt/87739094/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to