[lld] r247745 - [elf2] Add error checking for the R_X86_64_32 relocation.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 16:10:51 PDT 2015


On Tue, Sep 15, 2015 at 4:36 PM, Michael J. Spencer via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: mspencer
> Date: Tue Sep 15 18:36:30 2015
> New Revision: 247745
>
> URL: http://llvm.org/viewvc/llvm-project?rev=247745&view=rev
> Log:
> [elf2] Add error checking for the R_X86_64_32 relocation.
>
> Added:

[trim]

==============================================================================
> --- lld/trunk/test/elf2/relocation-errors.s (added)
> +++ lld/trunk/test/elf2/relocation-errors.s Tue Sep 15 18:36:30 2015
> @@ -0,0 +1,10 @@
> +// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/abs.s -o %tabs
> +// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
> +// RUN: not lld -flavor gnu2 %tabs %t -o %t2 2>&1 | FileCheck %s
> +// REQUIRES: x86
> +
> +.global _start
> +_start:
> +  movl $big, %edx
> +
> +#CHECK: Relocation out of range
>

Hi Michael,
sorry for resurrecting an old thread, but I just stumbled upon this.
Some comments:
1) I don't think you need _start if you produce a shared object. This
should simplify the test a little bit.
2) Can you put the name of the relocation in the error message? I
think that would be helpful.
3) The name of the file was probably OK for that time, but now it's
too generic. Either we merge all the relocs error test in one file, or
you rename it.
I don't have a strong preference, to be honest, but others might.

Thanks,

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the llvm-commits mailing list