This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81863] [7 regression] -mword-relocations is unreliable
- From: "arnd at linaro dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 19 Aug 2017 22:18:21 +0000
- Subject: [Bug target/81863] [7 regression] -mword-relocations is unreliable
- Auto-submitted: auto-generated
- References: <bug-81863-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81863
--- Comment #7 from Arnd Bergmann <arnd at linaro dot org> ---
Created attachment 42009
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42009&action=edit
preprocessed net/rds/recv.i
(In reply to ard.biesheuvel from comment #6)
> FWIW, the following makes the issue go away (tested on 4.9.4)
>
> @@ -6196,7 +6210,9 @@
> [(set (match_operand:SI 0 "nonimmediate_operand" "=r")
> (lo_sum:SI (match_operand:SI 1 "nonimmediate_operand" "0")
> (match_operand:SI 2 "general_operand" "i")))]
> - "arm_arch_thumb2 && arm_valid_symbolic_address_p (operands[2])"
> + "arm_arch_thumb2 && arm_valid_symbolic_address_p (operands[2])
> + && ( GET_CODE (operands[2]) != SYMBOL_REF
> + || !target_word_relocations)"
> "movt%?\t%0, #:upper16:%c2"
> [(set_attr "predicable" "yes")
> (set_attr "predicable_short_it" "no")
>
> I have no idea whether this is a suitable fix: I will leave that to the
> experts. Just providing this as a data point.
I tried this change and it apparently addressed one such problem on gcc-7.1.1
(in multiple kernel configurations):
/home/arnd/cross-gcc/bin/arm-linux-gnueabi-ld: drivers/mfd/janz-cmodio.o:
relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when
making a shared object; recompile with -fPIC
but not another one:
/home/arnd/cross-gcc/bin/arm-linux-gnueabi-ld: net/rds/recv.o: relocation
R_ARM_MOVW_ABS_NC against `rds_stats' can not be used when making a shared
object; recompile with -fPIC
The first only showed up in configurations using -mthumb, while the second only
appeared only once so far, in a configuration using -marm. Attaching the
preprocessed source file, build with "arm-linux-gnueabi-gcc-7.1.1
-mword-relocations -march=armv7-a -O1 -c recv.i"