[PATCH] D13169: [ELF2] - Implemented --allow-multiple-definition flag

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 05:44:15 PDT 2015


I can't apply the patch:

$ git apply -p0 ~/Downloads/D13169.diff
/home/espindola/Downloads/D13169.diff:9: trailing whitespace.
  bool AllowMultipleDefinition = false;
/home/espindola/Downloads/D13169.diff:21: trailing whitespace.
  if (Args.hasArg(OPT_allow_multiple_definition))
/home/espindola/Downloads/D13169.diff:22: trailing whitespace.
    Config->AllowMultipleDefinition = true;
/home/espindola/Downloads/D13169.diff:23: trailing whitespace.

/home/espindola/Downloads/D13169.diff:35: trailing whitespace.

error: patch failed: ELF/Config.h:25
error: ELF/Config.h: patch does not apply
error: patch failed: ELF/Driver.cpp:97
error: ELF/Driver.cpp: patch does not apply
error: patch failed: ELF/Options.td:37
error: ELF/Options.td: patch does not apply
error: patch failed: ELF/SymbolTable.cpp:150
error: ELF/SymbolTable.cpp: patch does not apply


On 28 September 2015 at 05:25, George Rimar <grimar at accesssoftek.com> wrote:
> grimar added inline comments.
>
> ================
> Comment at: ELF/SymbolTable.cpp:153-160
> @@ -152,5 +152,10 @@
>
> -  error(Twine("duplicate symbol: ") + Old.getName() + " in " +
> -        OldFile->getName() + " and " + NewFile->getName());
> +  std::string Msg = (Twine("duplicate symbol: ") + Old.getName() + " in " +
> +                     OldFile->getName() + " and " + NewFile->getName())
> +                        .str();
> +  if (Config->AllowMultipleDefinition)
> +    warning(Msg);
> +  else
> +    error(Msg);
>  }
>
> ----------------
> Ok. Fixed.
>
> ================
> Comment at: test/elf2/allow-multiple-definition.s:7
> @@ +6,3 @@
> +# RUN: lld -flavor gnu2 --allow-multiple-definition %t1 %t2 -o %t3
> +# RUN: lld -flavor gnu2 --allow-multiple-definition %t2 %t1 -o %t4
> +# RUN: llvm-objdump -d %t3 | FileCheck %s
> ----------------
> Good question. That definitely was a bug. Fixed.
>
>
> http://reviews.llvm.org/D13169
>
>
>


More information about the llvm-commits mailing list