[PATCH] D38625: [ELF] - Ignore non-absolute R_386_GOTPC relocation in debug sections.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 19:04:30 PDT 2017


George Rimar via Phabricator <reviews at reviews.llvm.org> writes:

> Index: ELF/InputSection.cpp
> ===================================================================
> --- ELF/InputSection.cpp
> +++ ELF/InputSection.cpp
> @@ -683,6 +683,12 @@
>      if (Expr == R_NONE)
>        continue;
>      if (Expr != R_ABS) {
> +      // gcc-5.4 has a bug which creates R_386_GOTPC relocation against
> +      // _GLOBAL_OFFSET_TABLE_ in .debug_info. We ignore such relocation.
> +      // TODO: remove this hack once we stop supporting gcc-5.4.
> +      if (Config->EMachine == EM_386 && Expr == R_GOTONLY_PC_FROM_END &&
> +          Sym.getName() == "_GLOBAL_OFFSET_TABLE_")
> +        continue;

You probably don't need to test getName(). It is just left as a side
effect of it being a magical symbol name is the .s.

Cheers,
Rafael


More information about the llvm-commits mailing list