[PATCH] D40826: [LLD] Use Rela on PowerPC too

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 17:38:31 PST 2017


LGTM with a testcase.

Nicholas Allegra via Phabricator via llvm-commits
<llvm-commits at lists.llvm.org> writes:

> comex created this revision.
> Herald added subscribers: nemanjai, emaste.
>
> The spec for ELF on PowerPC:
> http://refspecs.linux-foundation.org/elf/elfspec_ppc.pdf
> says:
> "The PowerPC family uses only the Elf32_Rela relocation entries with explicit addends."
>
> (EM_PPC64 should be covered by Config->Is64 already.)
>
>
> Repository:
>   rLLD LLVM Linker
>
> https://reviews.llvm.org/D40826
>
> Files:
>   ELF/Driver.cpp
>
>
> Index: ELF/Driver.cpp
> ===================================================================
> --- ELF/Driver.cpp
> +++ ELF/Driver.cpp
> @@ -793,7 +793,8 @@
>    Config->Endianness =
>        Config->IsLE ? support::endianness::little : support::endianness::big;
>    Config->IsMips64EL = (Kind == ELF64LEKind && Machine == EM_MIPS);
> -  Config->IsRela = Config->Is64 || IsX32 || Config->MipsN32Abi;
> +  Config->IsRela = Config->Is64 || IsX32 || Config->MipsN32Abi ||
> +                   Machine == EM_PPC;
>    Config->Pic = Config->Pie || Config->Shared;
>    Config->Wordsize = Config->Is64 ? 8 : 4;
>  }
>
>
> Index: ELF/Driver.cpp
> ===================================================================
> --- ELF/Driver.cpp
> +++ ELF/Driver.cpp
> @@ -793,7 +793,8 @@
>    Config->Endianness =
>        Config->IsLE ? support::endianness::little : support::endianness::big;
>    Config->IsMips64EL = (Kind == ELF64LEKind && Machine == EM_MIPS);
> -  Config->IsRela = Config->Is64 || IsX32 || Config->MipsN32Abi;
> +  Config->IsRela = Config->Is64 || IsX32 || Config->MipsN32Abi ||
> +                   Machine == EM_PPC;
>    Config->Pic = Config->Pie || Config->Shared;
>    Config->Wordsize = Config->Is64 ? 8 : 4;
>  }
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list