[PATCH] D26738: [ELF] - Improve diagnostic messages.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 07:57:18 PST 2016


LGTM with the "previously" dropped, this is not a duplicate symbol problem.

Cheers,
Rafael


On 16 November 2016 at 05:48, George Rimar <grimar at accesssoftek.com> wrote:
> grimar created this revision.
> grimar added reviewers: ruiu, rafael.
> grimar added subscribers: llvm-commits, grimar, evgeny777.
>
> Particulaty "cannot preempt symbol" message
> is extended with locations now.
>
>
> https://reviews.llvm.org/D26738
>
> Files:
>   ELF/Relocations.cpp
>   test/ELF/copy-errors.s
>
>
> Index: test/ELF/copy-errors.s
> ===================================================================
> --- test/ELF/copy-errors.s
> +++ test/ELF/copy-errors.s
> @@ -9,7 +9,7 @@
>
>
>  call bar
> -// CHECK: cannot preempt symbol bar
> +// CHECK: {{.*}}.o (.text+0x1): cannot preempt symbol 'bar' previously defined in {{.*}}.so
>
>  call zed
> -// CHECK: symbol zed is missing type
> +// CHECK: symbol 'zed' defined in {{.*}}.so is missing type
> Index: ELF/Relocations.cpp
> ===================================================================
> --- ELF/Relocations.cpp
> +++ ELF/Relocations.cpp
> @@ -453,7 +453,8 @@
>      return Expr;
>    }
>    if (Body.getVisibility() != STV_DEFAULT) {
> -    error("cannot preempt symbol " + Body.getName());
> +    error(getLocation(S, RelOff) + ": cannot preempt symbol '" +
> +          Body.getName() + "' previously defined in " + getFilename(Body.File));
>      return Expr;
>    }
>    if (Body.isObject()) {
> @@ -487,7 +488,8 @@
>      Body.NeedsCopyOrPltAddr = true;
>      return toPlt(Expr);
>    }
> -  error("symbol " + Body.getName() + " is missing type");
> +  error("symbol '" + Body.getName() + "' defined in " + getFilename(Body.File) +
> +        " is missing type");
>
>    return Expr;
>  }
>
>


More information about the llvm-commits mailing list