Commit Graph

9 Commits

Author SHA1 Message Date
Giulio Benetti
da2c1d9c56 package/binutils: add patches to fix OpenRisc bug 27624
These patches fix OpenRisc linker bug 27624 that affects packages
libtheora, protobuf and zeromq.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-03-30 21:57:43 +02:00
Max Filippov
f31db17a8d package/binutils: fix XTENSA_NDIFF handling for PR ld/25861
Fix for xtensa PR ld/25861 introduced a regression in handling negative
symbol differences resulting in linker performing incorrect relaxation
or failing to link. Fix XTENSA_NDIFF relocation handling.

Backported from:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=d548f47df4d2e3d117d504a4c9977982c78a0556

Fixes: f0291ef4ab ("package/binutils: fix xtensa PR ld/25861")
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Tested-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-05-01 22:14:07 +02:00
Max Filippov
f0291ef4ab package/binutils: fix xtensa PR ld/25861
Handle link-time relaxation of full 16-bit difference values correctly
in xtensa linker. This fixes the following kind of build errors:

.../five-point.cpp:338:(.debug_line+0x3b12):
       	dangerous relocation: overflow after relaxation

Backported from:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=30ce8e47fad9b057b6d7af9e1d43061126d34d20
Fixes:
http://autobuild.buildroot.net/results/67a5545779bbe8ca2b21da1f3ff2002053710ce1/
http://autobuild.buildroot.net/results/87f38998d2d60b6bce3128589973187ef9596e28/

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-04-23 23:31:54 +02:00
Max Filippov
1b887cfc69 package/binutils: fix assertion failure in xtensa ld
xtensa ld fails with the following message

  ld: BFD (GNU Binutils) 2.31.1 internal error, aborting at
  elf32-xtensa.c:3283 in elf_xtensa_finish_dynamic_sections

during domoticz package build. It happens because of mismatch between
the size allocated for dynamic relocations in the executable image and
the number of PLT relocations actually written to the image. The
mismatch is caused by the fact that undefined weak symbol is treated as
dynamic (and thus needing PLT relocation), but xtensa linker not
expecting that.

Fixes: http://autobuild.buildroot.net/results/7885705f1b1c0f31cf21b464150f5509929c1906/
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Backported from: e15a8da9c71336b06cb5f2706c3f6b7e6ddd95a3
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2020-03-08 17:39:37 +01:00
Romain Naour
e1c7dffb25 package/binutils/2.32: backport or1k upstream patch
Without this patch, the system build using qemu_or1k_defconfig
(gcc 9.2, binutils 2.32 and uClibc 1.0.32) doesn't boot.

https://mailman.uclibc-ng.org/pipermail/devel/2019-August/001895.html

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-10-20 16:18:28 +02:00
Max Filippov
de1d1577d7 package/binutils: fix loops relaxation in bare sections
The commit 197b5f9d1c ("package/binutils: fix loops relaxation in
xtensa gas") changed the way loop opcodes are relaxed resulting in build
failures in hand-made assembly code that has loops in sections without
.literal_position pseudo op or equivalent construct. This e.g. breaks
xtensa linux kernel build.

Fix that by adding literal position to the beginning of every section.

Fixes: 197b5f9d1c ("package/binutils: fix loops relaxation in xtensa
gas")
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-04-17 08:56:42 +02:00
Max Filippov
197b5f9d1c package/binutils: fix loops relaxation in xtensa gas
Loop relaxation logic in xtensa gas may produce code in which LEND
register doesn't match actual zero overhead loop end. Fix relaxation
code so that it produces a literal or a pair of const16 instructions
with associated relocation record that works correctly in the presence
of other relaxations. This fixes crash in X11 server caused by window
movement.

Loop relaxation has limited of 32K range, this fix removes this
limitation.

Fixes:
http://autobuild.buildroot.net/results/e05522ce540f4ac23f9a3a8fec724694d9a23101/

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-04-03 08:36:32 +02:00
Max Filippov
881dae3a9c package/binutils: xtensa: fix shrink_dynamic_reloc_sections
This fixes the following build error caused by link-time relaxation
removing copies of literals that reference undefined weak symbols with
PLT entries created due to -rdynamic option passed to g++ link command:

  ld: BFD (GNU Binutils) 2.31.1 internal error, aborting at
  elf32-xtensa.c:3292 in elf_xtensa_finish_dynamic_sections

Fixes:
http://autobuild.buildroot.net/results/d41/d41aae8a448c316187f9fbde40f1d077182bb244/
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-03-29 08:01:55 +01:00
Romain Naour
a4837f29a2 package/binutils: add support for binutils 2.32
Remove upstream ARC and Xtensa patches.
Keep all other patches from binutils 2.31.1.

See the release note:
https://sourceware.org/ml/binutils/2019-02/msg00010.html

While testing the Binutils 2.32 version bump, the Qemu xtensa
defconfig (that was using a kernel 4.16) needed to be updated with a
patch [1] from kernel 4.19 otherwise the kernel doesn't boot with
binutils 2.32 [2].

Since then, all Qemu defconfig has been updated by commit [3] to use a
4.19 kernel, so the issue no longer exists.

All other architectures has been tested using toolchain-builder [4].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4119ba211bc4f1bf638f41e50b7a0f329f58aa16
[2] https://www.sourceware.org/ml/binutils/2019-02/msg00015.html
[3] fd8a02fd75
[4] https://gitlab.com/kubu93/toolchains-builder/pipelines/45896638

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-03-12 22:47:42 +01:00