Compare commits
171
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e326fcff64 | ||
|
|
96c23d1d0f | ||
|
|
48fd63e504 | ||
|
|
92de0d76ad | ||
|
|
6823e59111 | ||
|
|
51484b29ca | ||
|
|
5c07dfcc1a | ||
|
|
ac16bb646f | ||
|
|
e2bcf6605a | ||
|
|
8bdc5e7c4d | ||
|
|
4b5743e523 | ||
|
|
8c7222ad03 | ||
|
|
f8367664f8 | ||
|
|
394c62b21b | ||
|
|
e5978dae85 | ||
|
|
9ec60e877e | ||
|
|
cfb83cc5a1 | ||
|
|
0c65499c3f | ||
|
|
8f11388f4e | ||
|
|
68c8f889f8 | ||
|
|
ebe83db655 | ||
|
|
59cbf37585 | ||
|
|
9e3e57394b | ||
|
|
06a0b11330 | ||
|
|
5b8d0ea147 | ||
|
|
0030cbd430 | ||
|
|
51c24ded8a | ||
|
|
783fadbc1f | ||
|
|
085d20e5e6 | ||
|
|
75496165dc | ||
|
|
edb32a03b5 | ||
|
|
3d78dbace2 | ||
|
|
808fbb17fc | ||
|
|
dc579e498b | ||
|
|
c00da436bf | ||
|
|
1beb978492 | ||
|
|
02a0b30b2c | ||
|
|
0e429b176b | ||
|
|
778e2e0467 | ||
|
|
81c93749ae | ||
|
|
4d172c8c01 | ||
|
|
50791af71f | ||
|
|
9368f3f23d | ||
|
|
9b83bb1382 | ||
|
|
08194ef159 | ||
|
|
760d76ac98 | ||
|
|
8ac2e592c0 | ||
|
|
b68047e324 | ||
|
|
3ae38ddea2 | ||
|
|
d0ed2725e9 | ||
|
|
3f0eb2782c | ||
|
|
576beb7c0a | ||
|
|
45a13be315 | ||
|
|
c2ebfe7d78 | ||
|
|
b84acf3f1d | ||
|
|
b4c92bdda3 | ||
|
|
8c3f281626 | ||
|
|
4a3639bad0 | ||
|
|
95b722eaa8 | ||
|
|
c68efce50c | ||
|
|
dba10b3a76 | ||
|
|
88007f9acc | ||
|
|
6e780387b4 | ||
|
|
0a2942afae | ||
|
|
104df75e90 | ||
|
|
1f187371d0 | ||
|
|
eb251b3008 | ||
|
|
378e9f4b11 | ||
|
|
e1137c06a0 | ||
|
|
2f6d7b6333 | ||
|
|
dfb045af5b | ||
|
|
e87d5f643b | ||
|
|
e0ba7321f8 | ||
|
|
0b10ed0d58 | ||
|
|
020149e4cd | ||
|
|
bbfc6f546e | ||
|
|
442b21f8cb | ||
|
|
f7b2865949 | ||
|
|
7a899d67e8 | ||
|
|
10f8934c59 | ||
|
|
c3e5a675dd | ||
|
|
8910dc505a | ||
|
|
c91b3c3ce2 | ||
|
|
c2bc364c08 | ||
|
|
c5e9b02251 | ||
|
|
00cb0f00fa | ||
|
|
ea77594f3f | ||
|
|
c4c11c2e1a | ||
|
|
13bca2271d | ||
|
|
c98e315838 | ||
|
|
2ad812a0b3 | ||
|
|
e7b8832a5e | ||
|
|
05bffd0613 | ||
|
|
8391f7d189 | ||
|
|
981850b353 | ||
|
|
ba91be05c2 | ||
|
|
c00a99c292 | ||
|
|
5b074ef1f3 | ||
|
|
1ffd14f28a | ||
|
|
4e48f5da05 | ||
|
|
eecf0e55d3 | ||
|
|
2774a21025 | ||
|
|
7fa481437e | ||
|
|
d70da0be78 | ||
|
|
f3b07e2ded | ||
|
|
c5aa3c5883 | ||
|
|
fd7312940a | ||
|
|
fffc553485 | ||
|
|
ae79f0f403 | ||
|
|
a5ff2a2828 | ||
|
|
97be782fd4 | ||
|
|
9d60b443e7 | ||
|
|
7aa9b9041d | ||
|
|
ab6dbf1c9f | ||
|
|
68b5b3fbf0 | ||
|
|
12916827e0 | ||
|
|
8a86b50092 | ||
|
|
bcff1166d4 | ||
|
|
bf1925cb97 | ||
|
|
28b19ccb48 | ||
|
|
ca6fab6ef9 | ||
|
|
6c5cf37880 | ||
|
|
901689bfcc | ||
|
|
14614d63f7 | ||
|
|
38fb1ad2a0 | ||
|
|
75d795c493 | ||
|
|
13c2242034 | ||
|
|
6381183d49 | ||
|
|
4cf819f80e | ||
|
|
98a74d81a8 | ||
|
|
4a321afa83 | ||
|
|
a2f0a2147a | ||
|
|
1ec75d777e | ||
|
|
8017840f04 | ||
|
|
ec86e30e66 | ||
|
|
da67bf6418 | ||
|
|
9784dcb385 | ||
|
|
3b4980677b | ||
|
|
e0d0fec9a8 | ||
|
|
74e049a0f3 | ||
|
|
d3a25a98d4 | ||
|
|
3558493454 | ||
|
|
b1336915b6 | ||
|
|
73ddf01dd8 | ||
|
|
713a76560b | ||
|
|
68436b2335 | ||
|
|
4174f79a57 | ||
|
|
7320e5dd62 | ||
|
|
9c108afab8 | ||
|
|
aa31d10808 | ||
|
|
4915b692c8 | ||
|
|
2fd33900f5 | ||
|
|
6ad1c7f12e | ||
|
|
b304a458bd | ||
|
|
b6c1151936 | ||
|
|
0845329e27 | ||
|
|
60d2395453 | ||
|
|
64e7c63528 | ||
|
|
5d5b397202 | ||
|
|
03a8d70f52 | ||
|
|
f5ea09e2a8 | ||
|
|
9217708122 | ||
|
|
a241dcec41 | ||
|
|
b544587806 | ||
|
|
448910b017 | ||
|
|
ace8179deb | ||
|
|
b8a1301e81 | ||
|
|
a7a58df5f0 | ||
|
|
6a07591484 | ||
|
|
080bcd047d | ||
|
|
fdb3291b8c |
@@ -1,3 +1,38 @@
|
||||
2021.05-rc2, released May 22th, 2021
|
||||
|
||||
Fixes all over the tree.
|
||||
|
||||
support/scripts/gen-missing-cpe: A script to query the list of
|
||||
CPE IDs for the packages enabled in the current configuration and:
|
||||
|
||||
- for CPE IDs that do not have any matching entry in the CPE
|
||||
database, it emits a warning
|
||||
|
||||
- for CPE IDs that do have a matching entry, but not with the same
|
||||
version, it generates a snippet of XML that can be used to propose
|
||||
an updated version to NIST.
|
||||
|
||||
CPE meta data has been added for a large number of packages
|
||||
|
||||
Updated/fixed packages: assimp, binutils, bitcoin, bullet,
|
||||
cutelyst, dhcp, dmalloc, docker-engine, ebtables,
|
||||
environment-setup, flatcc, gcc, gd, gerbera, hostapd,
|
||||
imx-gpu-viv, intel-microcode, jquery-validation, libdrm,
|
||||
libgeos, libraw, libtirpc, libxml2, libxslt, live555, lmbench,
|
||||
localedef, lvm2, mender, mender-grubenv, modem-manager, mutt,
|
||||
opensbi, openssh, opentyrian, pipewire, postgis, postgresql,
|
||||
prosody, python-bluezero, python-falcon, redis, rocksdb,
|
||||
rt-tests, runc, vlc, waylandpp, webkitgtk, wireshark,
|
||||
wpa_supplicant, wpewebkit, xlib_libX11, xterm
|
||||
|
||||
New packages: jh71xx-tools
|
||||
|
||||
Issues resolved (http://bugs.uclibc.org):
|
||||
|
||||
#13781: isc dhcp-server package don't create file /usr/bin/dhcpd
|
||||
#13801: toolchainfile.cmake CMAKE_BUILD_TYPE
|
||||
#13806: Building host-localedef fails on fedora 34/gcc 11
|
||||
|
||||
2021.05-rc1, released May 12th, 2021
|
||||
|
||||
Fixes all over the tree and new features.
|
||||
@@ -74,6 +109,57 @@
|
||||
#13751: libopenssl (static): huge drop in performance in newer ..
|
||||
#13771: package htop has undeclared dependency on host python
|
||||
|
||||
2021.02.2, released May 12th, 2021
|
||||
|
||||
Important / security related fixes.
|
||||
|
||||
Toolchain: Add logic to mark toolchains affected by binutils
|
||||
bug 27597 (Nios II).
|
||||
|
||||
support/scripts/cve.py: Use the (significantly) faster yajl2
|
||||
ijson backend for older (< 2.5) ijson versions rather than the
|
||||
slow python default, speeding up pkg-stats by ~2x.
|
||||
|
||||
CMake infrastructure: Use CMAKE_EXE_LINKER_FLAGS rather than
|
||||
CMAKE_CXX_FLAGS to link with libatomic to fix an compatibility
|
||||
issue with poppler.
|
||||
|
||||
Infrastructure: Expose CONFIG_DIR to post-build/post-image
|
||||
scripts, so they can call the Buildroot Makefile in the
|
||||
correct directory for both in-tree / out-of-tree builds.
|
||||
|
||||
Updated/fixed packages: at91bootstrap, avahi, bash, bind,
|
||||
bridge-utils, boost, cegui, cifs-utils, clamav, cmake,
|
||||
coremark-pro, coreutils, cryptsetup, dmalloc, dnsmasq,
|
||||
docker-cli, docker-engine, domoticz, efl, exim, ffmpeg, flex,
|
||||
gcc, genext2fs, go, gst1-interpipe, haproxy, hostapd,
|
||||
i2c-tools, imx-vpu, kexec, kf5-kcoreaddons, kismet, libcamera,
|
||||
libcurl, libdrm, libfreefare, libfuse3, libgeos, libgpiod,
|
||||
libnpupnp, libopenssl, libp11, librsync, libtomcrypt, libupnp,
|
||||
localedef, lvm2, lxc, m4, makedevs, mender, mesa3d,
|
||||
mesa3d-headers, mkpasswd, mkpimage, modem-manager, monkey,
|
||||
mpd, ncurses, nettle, network-manager, nginx, numactl,
|
||||
openjdk, openjdk-bin, openldap, openvpn, php, pipewire,
|
||||
python-aioconsole, python-asgiref, python-botocore,
|
||||
python-django, python-dnspython, python-flup, python-httplib2,
|
||||
python-markdown2, python-mbrstrdecoder, python3, quickjs,
|
||||
readline, rsyslog, ruby, rust, samba4, sconeserver, snort,
|
||||
sox, systemd, tar, timescaledb, tio, tor, usb_modeswitch,
|
||||
wpa_supplicant, xdriver_xf86-video-ati, xen, xlib_libXaw,
|
||||
xserver_xorg-server
|
||||
|
||||
Issues resolved (http://bugs.uclibc.org):
|
||||
|
||||
#13271: systemd-resolved: /etc/resolv.conf link broken on per-pa..
|
||||
#13551: 2021.02.rc2: Unicode not work on qt 5.15.2
|
||||
#13651: pkg-golang cannot build when main.go is in the root
|
||||
#13661: host-python2 build fails on aarch64
|
||||
#13721: c-stack.c:55:26: error: missing binary operator before ..
|
||||
#13731: Readline Patch is missing Author Information
|
||||
#13741: genext2fs does not allow to set perms of root node
|
||||
#13751: libopenssl (static): huge drop in performance in newer ..
|
||||
#13771: package htop has undeclared dependency on host python
|
||||
|
||||
2021.02.1, released April 7, 2021
|
||||
|
||||
Important / security related fixes.
|
||||
|
||||
+21
-1
@@ -146,6 +146,26 @@ endif
|
||||
|
||||
comment "Legacy options removed in 2021.05"
|
||||
|
||||
config BR2_PACKAGE_UDISKS_LVM2
|
||||
bool "udisks lvm2 support removed"
|
||||
select BR2_LEGACY
|
||||
help
|
||||
The lvm2 support was removed because udisks < 2.7.0 still
|
||||
depends on lvm2 application library, which was removed
|
||||
in lvm2.
|
||||
|
||||
config BR2_PACKAGE_LVM2_APP_LIBRARY
|
||||
bool "lvm2 application library removed"
|
||||
select BR2_LEGACY
|
||||
help
|
||||
The lvm2 application library was removed upstream.
|
||||
|
||||
config BR2_PACKAGE_LVM2_LVMETAD
|
||||
bool "lvm2 lvmetad removed"
|
||||
select BR2_LEGACY
|
||||
help
|
||||
The lvm2 lvmetad was removed upstream.
|
||||
|
||||
config BR2_PACKAGE_MONKEY
|
||||
bool "monkey package removed"
|
||||
select BR2_LEGACY
|
||||
@@ -162,7 +182,7 @@ config BR2_PACKAGE_DOCKER_CONTAINERD
|
||||
The package was renamed to containerd accordingly.
|
||||
|
||||
config BR2_PACKAGE_IOSTAT
|
||||
bool "iostat removed"
|
||||
bool "iostat package removed"
|
||||
select BR2_LEGACY
|
||||
help
|
||||
This package has been removed, use sysstat instead.
|
||||
|
||||
@@ -312,6 +312,7 @@ F: package/apache/
|
||||
F: package/apr/
|
||||
F: package/apr-util/
|
||||
F: package/bcg729/
|
||||
F: package/bitcoin/
|
||||
F: package/bluez-tools/
|
||||
F: package/boinc/
|
||||
F: package/clamav/
|
||||
@@ -676,6 +677,7 @@ F: package/ipcalc/
|
||||
|
||||
N: Dick Olsson <hi@senzilla.io>
|
||||
F: package/bearssl/
|
||||
F: package/bitcoin/
|
||||
F: package/execline/
|
||||
F: package/mdevd/
|
||||
F: package/s6-dns/
|
||||
@@ -2631,6 +2633,7 @@ F: package/heirloom-mailx/
|
||||
F: package/hiawatha/
|
||||
F: package/igh-ethercat/
|
||||
F: package/intltool/
|
||||
F: package/jh71xx-tools/
|
||||
F: package/libcap/
|
||||
F: package/libffi/
|
||||
F: package/libsha1/
|
||||
|
||||
@@ -92,9 +92,9 @@ all:
|
||||
.PHONY: all
|
||||
|
||||
# Set and export the version string
|
||||
export BR2_VERSION := 2021.05-rc1
|
||||
export BR2_VERSION := 2021.05-rc2
|
||||
# Actual time the release is cut (for reproducible builds)
|
||||
BR2_VERSION_EPOCH = 1620809000
|
||||
BR2_VERSION_EPOCH = 1621690900
|
||||
|
||||
# Save running make version since it's clobbered by the make package
|
||||
RUNNING_MAKE_VERSION := $(MAKE_VERSION)
|
||||
@@ -229,6 +229,8 @@ LEGAL_MANIFEST_CSV_HOST = $(LEGAL_INFO_DIR)/host-manifest.csv
|
||||
LEGAL_WARNINGS = $(LEGAL_INFO_DIR)/.warnings
|
||||
LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
|
||||
|
||||
CPE_UPDATES_DIR = $(BASE_DIR)/cpe-updates
|
||||
|
||||
BR2_CONFIG = $(CONFIG_DIR)/.config
|
||||
|
||||
# Pull in the user's configuration file
|
||||
@@ -945,6 +947,14 @@ pkg-stats:
|
||||
--html $(O)/pkg-stats.html \
|
||||
--nvd-path $(DL_DIR)/buildroot-nvd
|
||||
|
||||
.PHONY: missing-cpe
|
||||
missing-cpe:
|
||||
$(Q)mkdir -p $(CPE_UPDATES_DIR)
|
||||
$(Q)cd "$(CONFIG_DIR)" ; \
|
||||
$(TOPDIR)/support/scripts/gen-missing-cpe \
|
||||
--nvd-path $(DL_DIR)/buildroot-nvd \
|
||||
--output $(CPE_UPDATES_DIR)
|
||||
|
||||
else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
|
||||
|
||||
# Some subdirectories are also package names. To avoid that "make linux"
|
||||
@@ -1079,7 +1089,8 @@ printvars:
|
||||
clean:
|
||||
rm -rf $(BASE_TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) $(HOST_DIR_SYMLINK) \
|
||||
$(BUILD_DIR) $(BASE_DIR)/staging \
|
||||
$(LEGAL_INFO_DIR) $(GRAPHS_DIR) $(PER_PACKAGE_DIR)
|
||||
$(LEGAL_INFO_DIR) $(GRAPHS_DIR) $(PER_PACKAGE_DIR) $(CPE_UPDATES_DIR) \
|
||||
$(O)/pkg-stats.*
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
||||
@@ -1163,6 +1174,7 @@ help:
|
||||
@echo ' legal-info - generate info about license compliance'
|
||||
@echo ' show-info - generate info about packages, as a JSON blurb'
|
||||
@echo ' pkg-stats - generate info about packages as JSON and HTML'
|
||||
@echo ' missing-cpe - generate XML snippets for missing CPE identifiers'
|
||||
@echo ' printvars - dump internal variables selected with VARS=...'
|
||||
@echo
|
||||
@echo ' make V=0|1 - 0 => quiet build (default), 1 => verbose build'
|
||||
|
||||
@@ -119,4 +119,6 @@ bootloaders, so if you flash non-working versions, you'll have to go
|
||||
through a recovery process. This requires wiring up to a separate
|
||||
debug UART, which pins are located near the HDMI connector. See
|
||||
https://wiki.seeedstudio.com/BeagleV-Update-bootloader-ddr-init-boot-uboot-Recover-bootloader/
|
||||
section "Recover the bootloader" for more details.
|
||||
section "Recover the bootloader" for more details. The instructions
|
||||
make use of a jh7100-recover tool, which Buildroot has built as part
|
||||
of this defconfig: it is available as output/host/bin/jh7100-recover.
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From 8a054081678ed0b0e56f829bac0a4656e3a198b9 Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Sat, 8 May 2021 22:03:11 +0200
|
||||
Subject: [PATCH] arch/s390: disable SSP when needed
|
||||
|
||||
Though -nostdlib is passed in PURGATORY_LDFLAGS and -ffreestanding in
|
||||
KBUILD_CFLAGS_DECOMPRESSOR, -fno-stack-protector must also be passed to
|
||||
avoid linking errors related to undefined references to
|
||||
'__stack_chk_guard' and '__stack_chk_fail' if toolchain enforces
|
||||
-fstack-protector.
|
||||
|
||||
Fixes:
|
||||
- https://gitlab.com/kubu93/buildroot/-/jobs/1247043361
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
arch/s390/Makefile | 1 +
|
||||
arch/s390/purgatory/Makefile | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
|
||||
index e443ed9947bd..098abe3a56f3 100644
|
||||
--- a/arch/s390/Makefile
|
||||
+++ b/arch/s390/Makefile
|
||||
@@ -28,6 +28,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
|
||||
KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain
|
||||
KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
|
||||
KBUILD_CFLAGS_DECOMPRESSOR += -ffreestanding
|
||||
+KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector
|
||||
KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member)
|
||||
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
|
||||
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
|
||||
diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
|
||||
index c57f8c40e992..21c4ebe29b9a 100644
|
||||
--- a/arch/s390/purgatory/Makefile
|
||||
+++ b/arch/s390/purgatory/Makefile
|
||||
@@ -24,6 +24,7 @@ KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
|
||||
KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
|
||||
KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
|
||||
KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common
|
||||
+KBUILD_CFLAGS += -fno-stack-protector
|
||||
KBUILD_CFLAGS += $(CLANG_FLAGS)
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
|
||||
KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS))
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -20,7 +20,9 @@ OPENSBI_SITE = $(call github,riscv,opensbi,v$(OPENSBI_VERSION))
|
||||
endif
|
||||
|
||||
OPENSBI_LICENSE = BSD-2-Clause
|
||||
ifeq ($(BR2_TARGET_OPENSBI_LATEST_VERSION),y)
|
||||
OPENSBI_LICENSE_FILES = COPYING.BSD
|
||||
endif
|
||||
OPENSBI_INSTALL_TARGET = NO
|
||||
OPENSBI_INSTALL_STAGING = YES
|
||||
|
||||
|
||||
@@ -35,3 +35,4 @@ BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
|
||||
BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,u-boot,3f3ac01a29ad1cd5fa519d86f81daead2447f1d4)/uboot-3f3ac01a29ad1cd5fa519d86f81daead2447f1d4.tar.gz"
|
||||
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="starfive_vic7100_beagle_v_smode"
|
||||
BR2_PACKAGE_HOST_GENIMAGE=y
|
||||
BR2_PACKAGE_HOST_JH71XX_TOOLS=y
|
||||
|
||||
@@ -20,6 +20,7 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.7"
|
||||
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
|
||||
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
|
||||
BR2_GLOBAL_PATCH_DIR="board/qemu/s390x/patches"
|
||||
|
||||
# host-qemu for gitlab testing
|
||||
BR2_PACKAGE_HOST_QEMU=y
|
||||
|
||||
@@ -9,7 +9,7 @@ BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,96110e96f1a82e236afb9a248258f1ef917766e9)/linux-96110e96f1a82e236afb9a248258f1ef917766e9.tar.gz"
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,b657cd2f27d9171b75c846f21e7b4bb581b3ed29)/linux-b657cd2f27d9171b75c846f21e7b4bb581b3ed29.tar.gz"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi"
|
||||
|
||||
# Build the DTBs for A/B from the kernel sources: the zero is the same
|
||||
|
||||
@@ -9,7 +9,7 @@ BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,96110e96f1a82e236afb9a248258f1ef917766e9)/linux-96110e96f1a82e236afb9a248258f1ef917766e9.tar.gz"
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,b657cd2f27d9171b75c846f21e7b4bb581b3ed29)/linux-b657cd2f27d9171b75c846f21e7b4bb581b3ed29.tar.gz"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi"
|
||||
BR2_LINUX_KERNEL_DTS_SUPPORT=y
|
||||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-zero-w"
|
||||
|
||||
@@ -12,7 +12,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
|
||||
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,96110e96f1a82e236afb9a248258f1ef917766e9)/linux-96110e96f1a82e236afb9a248258f1ef917766e9.tar.gz"
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,b657cd2f27d9171b75c846f21e7b4bb581b3ed29)/linux-b657cd2f27d9171b75c846f21e7b4bb581b3ed29.tar.gz"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
|
||||
|
||||
# Build the DTB from the kernel sources
|
||||
|
||||
@@ -11,7 +11,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
|
||||
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,96110e96f1a82e236afb9a248258f1ef917766e9)/linux-96110e96f1a82e236afb9a248258f1ef917766e9.tar.gz"
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,b657cd2f27d9171b75c846f21e7b4bb581b3ed29)/linux-b657cd2f27d9171b75c846f21e7b4bb581b3ed29.tar.gz"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi3"
|
||||
|
||||
# Build the DTB from the kernel sources
|
||||
|
||||
@@ -11,7 +11,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
|
||||
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,96110e96f1a82e236afb9a248258f1ef917766e9)/linux-96110e96f1a82e236afb9a248258f1ef917766e9.tar.gz"
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,b657cd2f27d9171b75c846f21e7b4bb581b3ed29)/linux-b657cd2f27d9171b75c846f21e7b4bb581b3ed29.tar.gz"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
|
||||
|
||||
# Build the DTB from the kernel sources
|
||||
|
||||
@@ -12,7 +12,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
|
||||
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,96110e96f1a82e236afb9a248258f1ef917766e9)/linux-96110e96f1a82e236afb9a248258f1ef917766e9.tar.gz"
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,b657cd2f27d9171b75c846f21e7b4bb581b3ed29)/linux-b657cd2f27d9171b75c846f21e7b4bb581b3ed29.tar.gz"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
|
||||
|
||||
# Build the DTB from the kernel sources
|
||||
|
||||
@@ -11,7 +11,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
|
||||
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,96110e96f1a82e236afb9a248258f1ef917766e9)/linux-96110e96f1a82e236afb9a248258f1ef917766e9.tar.gz"
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,b657cd2f27d9171b75c846f21e7b4bb581b3ed29)/linux-b657cd2f27d9171b75c846f21e7b4bb581b3ed29.tar.gz"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
|
||||
|
||||
# Build the DTB from the kernel sources
|
||||
|
||||
@@ -11,7 +11,7 @@ BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
|
||||
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,96110e96f1a82e236afb9a248258f1ef917766e9)/linux-96110e96f1a82e236afb9a248258f1ef917766e9.tar.gz"
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,b657cd2f27d9171b75c846f21e7b4bb581b3ed29)/linux-b657cd2f27d9171b75c846f21e7b4bb581b3ed29.tar.gz"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
|
||||
|
||||
# Build the DTB from the kernel sources
|
||||
|
||||
@@ -11,7 +11,7 @@ BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,96110e96f1a82e236afb9a248258f1ef917766e9)/linux-96110e96f1a82e236afb9a248258f1ef917766e9.tar.gz"
|
||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,b657cd2f27d9171b75c846f21e7b4bb581b3ed29)/linux-b657cd2f27d9171b75c846f21e7b4bb581b3ed29.tar.gz"
|
||||
BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi"
|
||||
|
||||
# Build the DTBs for A/B, A+/B+ and compute module from the kernel sources
|
||||
|
||||
+18
-18
@@ -8,37 +8,37 @@
|
||||
<div class="panel-heading">Download</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<h3 style="text-align: center;">Latest stable / long term support release: <b>2021.02.1</b></h3>
|
||||
<h3 style="text-align: center;">Latest stable / long term support release: <b>2021.02.2</b></h3>
|
||||
|
||||
<div class="row mt centered">
|
||||
<div class="col-sm-6">
|
||||
<div class="flip-container center-block" ontouchstart="this.classList.toggle('hover');">
|
||||
<div class="flipper">
|
||||
<div class="front">
|
||||
<a href="/downloads/buildroot-2021.02.1.tar.gz"><img src="images/zip.png" width="180" alt=""></a>
|
||||
<a href="/downloads/buildroot-2021.02.2.tar.gz"><img src="images/zip.png" width="180" alt=""></a>
|
||||
</div>
|
||||
<div class="back">
|
||||
<a href="/downloads/buildroot-2021.02.1.tar.gz"><img src="images/zip.png" width="180" alt=""></a>
|
||||
<a href="/downloads/buildroot-2021.02.2.tar.gz"><img src="images/zip.png" width="180" alt=""></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h3><a href="/downloads/buildroot-2021.02.1.tar.gz">buildroot-2021.02.1.tar.gz</a></h3>
|
||||
<p><a href="/downloads/buildroot-2021.02.1.tar.gz.sign">PGP signature</a></p>
|
||||
<h3><a href="/downloads/buildroot-2021.02.2.tar.gz">buildroot-2021.02.2.tar.gz</a></h3>
|
||||
<p><a href="/downloads/buildroot-2021.02.2.tar.gz.sign">PGP signature</a></p>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="flip-container center-block" ontouchstart="this.classList.toggle('hover');">
|
||||
<div class="flipper">
|
||||
<div class="front">
|
||||
<a href="/downloads/buildroot-2021.02.1.tar.bz2"><img src="images/package.png" width="180" alt=""></a>
|
||||
<a href="/downloads/buildroot-2021.02.2.tar.bz2"><img src="images/package.png" width="180" alt=""></a>
|
||||
</div>
|
||||
<div class="back">
|
||||
<a href="/downloads/buildroot-2021.02.1.tar.bz2"><img src="images/package.png" width="180" alt=""></a>
|
||||
<a href="/downloads/buildroot-2021.02.2.tar.bz2"><img src="images/package.png" width="180" alt=""></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3><a href="/downloads/buildroot-2021.02.1.tar.bz2">buildroot-2021.02.1.tar.bz2</a></h3>
|
||||
<p><a href="/downloads/buildroot-2021.02.1.tar.bz2.sign">PGP signature</a></p>
|
||||
<h3><a href="/downloads/buildroot-2021.02.2.tar.bz2">buildroot-2021.02.2.tar.bz2</a></h3>
|
||||
<p><a href="/downloads/buildroot-2021.02.2.tar.bz2.sign">PGP signature</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
@@ -76,37 +76,37 @@
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<h3 style="text-align: center;">Latest release candidate: <b>2021.05-rc1</b></h3>
|
||||
<h3 style="text-align: center;">Latest release candidate: <b>2021.05-rc2</b></h3>
|
||||
<div class="row mt centered">
|
||||
<div class="col-sm-6">
|
||||
<div class="flip-container center-block" ontouchstart="this.classList.toggle('hover');">
|
||||
<div class="flipper">
|
||||
<div class="front">
|
||||
<a href="/downloads/buildroot-2021.05-rc1.tar.gz"><img src="images/zip.png" width="180" alt=""></a>
|
||||
<a href="/downloads/buildroot-2021.05-rc2.tar.gz"><img src="images/zip.png" width="180" alt=""></a>
|
||||
</div>
|
||||
<div class="back">
|
||||
<a href="/downloads/buildroot-2021.05-rc1.tar.gz"><img src="images/zip.png" width="180" alt=""></a>
|
||||
<a href="/downloads/buildroot-2021.05-rc2.tar.gz"><img src="images/zip.png" width="180" alt=""></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3><a href="/downloads/buildroot-2021.05-rc1.tar.gz">buildroot-2021.05-rc1.tar.gz</a></h3>
|
||||
<p><a href="/downloads/buildroot-2021.05-rc1.tar.gz.sign">PGP signature</a></p>
|
||||
<h3><a href="/downloads/buildroot-2021.05-rc2.tar.gz">buildroot-2021.05-rc2.tar.gz</a></h3>
|
||||
<p><a href="/downloads/buildroot-2021.05-rc2.tar.gz.sign">PGP signature</a></p>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="flip-container center-block" ontouchstart="this.classList.toggle('hover');">
|
||||
<div class="flipper">
|
||||
<div class="front">
|
||||
<a href="/downloads/buildroot-2021.05-rc1.tar.bz2"><img src="images/package.png" width="180" alt=""></a>
|
||||
<a href="/downloads/buildroot-2021.05-rc2.tar.bz2"><img src="images/package.png" width="180" alt=""></a>
|
||||
</div>
|
||||
<div class="back">
|
||||
<a href="/downloads/buildroot-2021.05-rc1.tar.bz2"><img src="images/package.png" width="180" alt=""></a>
|
||||
<a href="/downloads/buildroot-2021.05-rc2.tar.bz2"><img src="images/package.png" width="180" alt=""></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3><a href="/downloads/buildroot-2021.05-rc1.tar.bz2">buildroot-2021.05-rc1.tar.bz2</a></h3>
|
||||
<p><a href="/downloads/buildroot-2021.05-rc1.tar.bz2.sign">PGP signature</a></p>
|
||||
<h3><a href="/downloads/buildroot-2021.05-rc2.tar.bz2">buildroot-2021.05-rc2.tar.bz2</a></h3>
|
||||
<p><a href="/downloads/buildroot-2021.05-rc2.tar.bz2.sign">PGP signature</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -9,6 +9,25 @@
|
||||
<h2>News</h2>
|
||||
<ul class="timeline">
|
||||
|
||||
<li class="timeline-inverted">
|
||||
<div class="timeline-badge"><i class="glyphicon glyphicon-thumbs-up"></i></div>
|
||||
<div class="timeline-panel">
|
||||
<div class="timeline-heading">
|
||||
<h4 class="timeline-title">2021.02.2 released</h4>
|
||||
<p><small class="text-muted"><i class="glyphicon glyphicon-time"></i>12 May 2021</small></p>
|
||||
</div>
|
||||
<div class="timeline-body">
|
||||
<p>The 2021.02.2 bugfix release is out, fixing a number of important /
|
||||
security related issues discovered since the 2021.02.1 release. See the
|
||||
<a href="http://git.buildroot.net/buildroot/plain/CHANGES?id=2021.02.2">CHANGES</a>
|
||||
file for more details, read the
|
||||
<a href="http://lists.busybox.net/pipermail/buildroot/2021-May/310003.html">announcement</a>
|
||||
and go to the <a href="/downloads/">downloads page</a> to pick up the
|
||||
<a href="/downloads/buildroot-2021.02.2.tar.bz2">2021.02.2 release</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<div class="timeline-badge"><i class="glyphicon glyphicon-thumbs-up"></i></div>
|
||||
<div class="timeline-panel">
|
||||
|
||||
+1
-1
@@ -125,7 +125,7 @@ endif
|
||||
|
||||
config BR2_LINUX_KERNEL_VERSION
|
||||
string
|
||||
default "5.12.2" if BR2_LINUX_KERNEL_LATEST_VERSION
|
||||
default "5.12.4" if BR2_LINUX_KERNEL_LATEST_VERSION
|
||||
default "4.19.182-cip45" if BR2_LINUX_KERNEL_LATEST_CIP_VERSION
|
||||
default "4.19.165-cip41-rt18" if BR2_LINUX_KERNEL_LATEST_CIP_RT_VERSION
|
||||
default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE \
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
# From https://www.kernel.org/pub/linux/kernel/v5.x/sha256sums.asc
|
||||
sha256 8c98b9996d15fdb779a866c6a4c7c9b9e63374cb7105a5a59e9bcf8df02ef70d linux-5.12.2.tar.xz
|
||||
sha256 5aee19ad466b5bbbde642077f42bfaafff4e612296bdd7946faa01d917472b4b linux-5.11.19.tar.xz
|
||||
sha256 ac37a19d45b77a87e58e3aae8b127a6e7eb85ed7467fc8e58474b387bfd498fd linux-5.10.35.tar.xz
|
||||
sha256 4e989b5775830092e5c76b5cca65ebff862ad0c87d0b58c3a20d415c3d4ec770 linux-5.4.117.tar.xz
|
||||
sha256 5a60feee8492732a6aa8c46b9412563959945b4d7b0d27223f15ede2f84b6873 linux-5.12.4.tar.xz
|
||||
sha256 366ba5bb00be28b604aac630c4f64301063892f27353b299177c396af0ad877f linux-5.11.21.tar.xz
|
||||
sha256 a8d5e3309dafc484eb70f94747a6efffa29a79bae651ae126333e913c00be077 linux-5.10.37.tar.xz
|
||||
sha256 71e7decf1e8149a8aed88d30df4f2a62a6c6b168111de6b261685ac7c0ecb2a0 linux-5.4.119.tar.xz
|
||||
# From https://www.kernel.org/pub/linux/kernel/v4.x/sha256sums.asc
|
||||
sha256 6817ad26e1621bfad48d08b638f66c5933e89c7c8c00d43195b2e0ae260233eb linux-4.4.268.tar.xz
|
||||
sha256 5b66f6ce0137fb8d81004bcf2f1e3cbe01c38aab74268656c4ba015c1ccd762a linux-4.9.268.tar.xz
|
||||
|
||||
@@ -39,6 +39,7 @@ menu "Host utilities"
|
||||
source "package/imagemagick/Config.in.host"
|
||||
source "package/imx-mkimage/Config.in.host"
|
||||
source "package/imx-usb-loader/Config.in.host"
|
||||
source "package/jh71xx-tools/Config.in.host"
|
||||
source "package/jq/Config.in.host"
|
||||
source "package/jsmin/Config.in.host"
|
||||
source "package/kmod/Config.in.host"
|
||||
|
||||
+1638
File diff suppressed because it is too large
Load Diff
@@ -1,50 +0,0 @@
|
||||
From 3fef857a570d1ef2c96401358fe8e239625b48c9 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Seiderer <ps.report@gmx.net>
|
||||
Date: Fri, 10 Apr 2020 18:11:50 +0200
|
||||
Subject: [PATCH] contrib/zip: fix ssize_t typedef mismatch for musl compile
|
||||
|
||||
Musl uses defines __DEFINED_ssize_t to indicate ssize_t
|
||||
availability. So backport this part of upstream commit [1]
|
||||
to fixl musl compile.
|
||||
|
||||
https://github.com/assimp/assimp/commit/f78446b14aff46db2ef27d062a275b6a01fd68b1
|
||||
|
||||
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
|
||||
---
|
||||
contrib/zip/src/zip.h | 13 +++++++++++--
|
||||
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/contrib/zip/src/zip.h b/contrib/zip/src/zip.h
|
||||
index 5f39df50..4672eb3e 100644
|
||||
--- a/contrib/zip/src/zip.h
|
||||
+++ b/contrib/zip/src/zip.h
|
||||
@@ -20,8 +20,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(_SSIZE_T_DEFINED) && !defined(_SSIZE_T_DEFINED_) && \
|
||||
- !defined(_SSIZE_T) && !defined(_SSIZE_T_) && !defined(__ssize_t_defined)
|
||||
-#define _SSIZE_T
|
||||
+ !defined(__DEFINED_ssize_t) && !defined(__ssize_t_defined) && \
|
||||
+ !defined(_SSIZE_T) && !defined(_SSIZE_T_)
|
||||
+
|
||||
// 64-bit Windows is the only mainstream platform
|
||||
// where sizeof(long) != sizeof(void*)
|
||||
#ifdef _WIN64
|
||||
@@ -29,6 +30,14 @@ typedef long long ssize_t; /* byte count or error */
|
||||
#else
|
||||
typedef long ssize_t; /* byte count or error */
|
||||
#endif
|
||||
+
|
||||
+#define _SSIZE_T_DEFINED
|
||||
+#define _SSIZE_T_DEFINED_
|
||||
+#define __DEFINED_ssize_t
|
||||
+#define __ssize_t_defined
|
||||
+#define _SSIZE_T
|
||||
+#define _SSIZE_T_
|
||||
+
|
||||
#endif
|
||||
|
||||
#ifndef MAX_PATH
|
||||
--
|
||||
2.26.0
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
From bb3db0ebaffc6b76de256e597ec1d1e4d2a6663f Mon Sep 17 00:00:00 2001
|
||||
From: kimkulling <kim.kulling@googlemail.com>
|
||||
Date: Mon, 9 Mar 2020 10:51:26 +0100
|
||||
Subject: [PATCH] closes https://github.com/assimp/assimp/issues/2954: upgrade
|
||||
to latest greatest.
|
||||
|
||||
[Retrieved from:
|
||||
https://github.com/assimp/assimp/commit/bb3db0ebaffc6b76de256e597ec1d1e4d2a6663f]
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
contrib/zip/CMakeLists.txt | 8 ++----
|
||||
contrib/zip/README.md | 51 +++++++++++++++++++++++++++++++--
|
||||
contrib/zip/src/zip.c | 17 ++++++++++-
|
||||
contrib/zip/src/zip.h | 13 ++++++++-
|
||||
contrib/zip/test/CMakeLists.txt | 5 ----
|
||||
contrib/zip/test/test.c | 4 ++-
|
||||
6 files changed, 81 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/contrib/zip/CMakeLists.txt b/contrib/zip/CMakeLists.txt
|
||||
index 77916d2e14..f194649ede 100644
|
||||
--- a/contrib/zip/CMakeLists.txt
|
||||
+++ b/contrib/zip/CMakeLists.txt
|
||||
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(zip
|
||||
LANGUAGES C
|
||||
- VERSION "0.1.15")
|
||||
+ VERSION "0.1.18")
|
||||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
||||
|
||||
option(CMAKE_DISABLE_TESTING "Disable test creation" OFF)
|
||||
@@ -16,10 +16,6 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
|
||||
"${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
|
||||
"${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -Werror -pedantic")
|
||||
- if(ENABLE_COVERAGE)
|
||||
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
|
||||
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
|
||||
- endif()
|
||||
endif (MSVC)
|
||||
|
||||
# zip
|
||||
@@ -35,7 +31,7 @@ if (NOT CMAKE_DISABLE_TESTING)
|
||||
enable_testing()
|
||||
add_subdirectory(test)
|
||||
find_package(Sanitizers)
|
||||
- add_sanitizers(${PROJECT_NAME} ${test_out} ${test_miniz_out})
|
||||
+ add_sanitizers(${PROJECT_NAME} ${test_out})
|
||||
endif()
|
||||
|
||||
####
|
||||
diff --git a/contrib/zip/README.md b/contrib/zip/README.md
|
||||
index 14eb9a34c8..bdd0822b67 100644
|
||||
--- a/contrib/zip/README.md
|
||||
+++ b/contrib/zip/README.md
|
||||
@@ -1,10 +1,8 @@
|
||||
### A portable (OSX/Linux/Windows), simple zip library written in C
|
||||
This is done by hacking awesome [miniz](https://code.google.com/p/miniz) library and layering functions on top of the miniz v1.15 API.
|
||||
|
||||
-[](https://ci.appveyor.com/project/kuba--/zip)
|
||||
-[](https://travis-ci.org/kuba--/zip)
|
||||
+[](https://github.com/kuba--/zip/actions?query=workflow%3Abuild)
|
||||
[](https://github.com/kuba--/zip/releases)
|
||||
-[](https://codecov.io/gh/kuba--/zip)
|
||||
|
||||
|
||||
# The Idea
|
||||
@@ -213,6 +211,53 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
+### Rust (ffi)
|
||||
+```rust
|
||||
+extern crate libc;
|
||||
+use std::ffi::CString;
|
||||
+
|
||||
+#[repr(C)]
|
||||
+pub struct Zip {
|
||||
+ _private: [u8; 0],
|
||||
+}
|
||||
+
|
||||
+#[link(name = "zip")]
|
||||
+extern "C" {
|
||||
+ fn zip_open(path: *const libc::c_char, level: libc::c_int, mode: libc::c_char) -> *mut Zip;
|
||||
+ fn zip_close(zip: *mut Zip) -> libc::c_void;
|
||||
+
|
||||
+ fn zip_entry_open(zip: *mut Zip, entryname: *const libc::c_char) -> libc::c_int;
|
||||
+ fn zip_entry_close(zip: *mut Zip) -> libc::c_int;
|
||||
+ fn zip_entry_write(
|
||||
+ zip: *mut Zip,
|
||||
+ buf: *const libc::c_void,
|
||||
+ bufsize: libc::size_t,
|
||||
+ ) -> libc::c_int;
|
||||
+}
|
||||
+
|
||||
+fn main() {
|
||||
+ let path = CString::new("/tmp/test.zip").unwrap();
|
||||
+ let mode: libc::c_char = 'w' as libc::c_char;
|
||||
+
|
||||
+ let entryname = CString::new("test.txt").unwrap();
|
||||
+ let content = "test content\0";
|
||||
+
|
||||
+ unsafe {
|
||||
+ let zip: *mut Zip = zip_open(path.as_ptr(), 5, mode);
|
||||
+ {
|
||||
+ zip_entry_open(zip, entryname.as_ptr());
|
||||
+ {
|
||||
+ let buf = content.as_ptr() as *const libc::c_void;
|
||||
+ let bufsize = content.len() as libc::size_t;
|
||||
+ zip_entry_write(zip, buf, bufsize);
|
||||
+ }
|
||||
+ zip_entry_close(zip);
|
||||
+ }
|
||||
+ zip_close(zip);
|
||||
+ }
|
||||
+}
|
||||
+```
|
||||
+
|
||||
### Ruby (ffi)
|
||||
Install _ffi_ gem.
|
||||
```shell
|
||||
diff --git a/contrib/zip/src/zip.c b/contrib/zip/src/zip.c
|
||||
index 1abcfd8fd1..3b2821e6a3 100644
|
||||
--- a/contrib/zip/src/zip.c
|
||||
+++ b/contrib/zip/src/zip.c
|
||||
@@ -222,6 +222,20 @@ void zip_close(struct zip_t *zip) {
|
||||
}
|
||||
}
|
||||
|
||||
+int zip_is64(struct zip_t *zip) {
|
||||
+ if (!zip) {
|
||||
+ // zip_t handler is not initialized
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (!zip->archive.m_pState) {
|
||||
+ // zip state is not initialized
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return (int)zip->archive.m_pState->m_zip64;
|
||||
+}
|
||||
+
|
||||
int zip_entry_open(struct zip_t *zip, const char *entryname) {
|
||||
size_t entrylen = 0;
|
||||
mz_zip_archive *pzip = NULL;
|
||||
@@ -794,7 +808,8 @@ int zip_create(const char *zipname, const char *filenames[], size_t len) {
|
||||
|
||||
if (MZ_FILE_STAT(name, &file_stat) != 0) {
|
||||
// problem getting information - check errno
|
||||
- return -1;
|
||||
+ status = -1;
|
||||
+ break;
|
||||
}
|
||||
|
||||
if ((file_stat.st_mode & 0200) == 0) {
|
||||
diff --git a/contrib/zip/src/zip.h b/contrib/zip/src/zip.h
|
||||
index a48d64d6de..cd3ab5cd00 100644
|
||||
--- a/contrib/zip/src/zip.h
|
||||
+++ b/contrib/zip/src/zip.h
|
||||
@@ -21,7 +21,7 @@ extern "C" {
|
||||
|
||||
#if !defined(_SSIZE_T_DEFINED) && !defined(_SSIZE_T_DEFINED_) && \
|
||||
!defined(__DEFINED_ssize_t) && !defined(__ssize_t_defined) && \
|
||||
- !defined(_SSIZE_T) && !defined(_SSIZE_T_)
|
||||
+ !defined(_SSIZE_T) && !defined(_SSIZE_T_) && !defined(_SSIZE_T_DECLARED)
|
||||
|
||||
// 64-bit Windows is the only mainstream platform
|
||||
// where sizeof(long) != sizeof(void*)
|
||||
@@ -37,6 +37,7 @@ typedef long ssize_t; /* byte count or error */
|
||||
#define __ssize_t_defined
|
||||
#define _SSIZE_T
|
||||
#define _SSIZE_T_
|
||||
+#define _SSIZE_T_DECLARED
|
||||
|
||||
#endif
|
||||
|
||||
@@ -90,6 +91,16 @@ extern struct zip_t *zip_open(const char *zipname, int level, char mode);
|
||||
*/
|
||||
extern void zip_close(struct zip_t *zip);
|
||||
|
||||
+/**
|
||||
+ * Determines if the archive has a zip64 end of central directory headers.
|
||||
+ *
|
||||
+ * @param zip zip archive handler.
|
||||
+ *
|
||||
+ * @return the return code - 1 (true), 0 (false), negative number (< 0) on
|
||||
+ * error.
|
||||
+ */
|
||||
+extern int zip_is64(struct zip_t *zip);
|
||||
+
|
||||
/**
|
||||
* Opens an entry by name in the zip archive.
|
||||
*
|
||||
diff --git a/contrib/zip/test/CMakeLists.txt b/contrib/zip/test/CMakeLists.txt
|
||||
index cc060b00fe..1224115858 100644
|
||||
--- a/contrib/zip/test/CMakeLists.txt
|
||||
+++ b/contrib/zip/test/CMakeLists.txt
|
||||
@@ -2,15 +2,10 @@ cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
# test
|
||||
set(test_out test.out)
|
||||
-set(test_miniz_out test_miniz.out)
|
||||
|
||||
add_executable(${test_out} test.c)
|
||||
target_link_libraries(${test_out} zip)
|
||||
-add_executable(${test_miniz_out} test_miniz.c)
|
||||
-target_link_libraries(${test_miniz_out} zip)
|
||||
|
||||
add_test(NAME ${test_out} COMMAND ${test_out})
|
||||
-add_test(NAME ${test_miniz_out} COMMAND ${test_miniz_out})
|
||||
|
||||
set(test_out ${test_out} PARENT_SCOPE)
|
||||
-set(test_miniz_out ${test_miniz_out} PARENT_SCOPE)
|
||||
diff --git a/contrib/zip/test/test.c b/contrib/zip/test/test.c
|
||||
index a9b2ddab1e..9cc2248ac0 100644
|
||||
--- a/contrib/zip/test/test.c
|
||||
+++ b/contrib/zip/test/test.c
|
||||
@@ -47,7 +47,7 @@ static void test_write(void) {
|
||||
assert(CRC32DATA1 == zip_entry_crc32(zip));
|
||||
++total_entries;
|
||||
assert(0 == zip_entry_close(zip));
|
||||
-
|
||||
+ assert(0 == zip_is64(zip));
|
||||
zip_close(zip);
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@ static void test_read(void) {
|
||||
size_t buftmp;
|
||||
struct zip_t *zip = zip_open(ZIPNAME, 0, 'r');
|
||||
assert(zip != NULL);
|
||||
+ assert(0 == zip_is64(zip));
|
||||
|
||||
assert(0 == zip_entry_open(zip, "test\\test-1.txt"));
|
||||
assert(strlen(TESTDATA1) == zip_entry_size(zip));
|
||||
@@ -310,6 +311,7 @@ static void test_fwrite(void) {
|
||||
assert(0 == zip_entry_open(zip, WFILE));
|
||||
assert(0 == zip_entry_fwrite(zip, WFILE));
|
||||
assert(0 == zip_entry_close(zip));
|
||||
+ assert(0 == zip_is64(zip));
|
||||
|
||||
zip_close(zip);
|
||||
remove(WFILE);
|
||||
@@ -1,31 +0,0 @@
|
||||
From 2b8684aded0c383be64bac0fa59e39870252963f Mon Sep 17 00:00:00 2001
|
||||
From: Peter Seiderer <ps.report@gmx.net>
|
||||
Date: Sun, 12 Apr 2020 18:19:13 +0200
|
||||
Subject: [PATCH] contrib/zlib: disable dynamic library building
|
||||
|
||||
Fixes compile failure for static only toolchains (and assimp
|
||||
links against the static one).
|
||||
|
||||
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
|
||||
---
|
||||
contrib/zlib/CMakeLists.txt | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/contrib/zlib/CMakeLists.txt b/contrib/zlib/CMakeLists.txt
|
||||
index 9d1fcc94..78346233 100644
|
||||
--- a/contrib/zlib/CMakeLists.txt
|
||||
+++ b/contrib/zlib/CMakeLists.txt
|
||||
@@ -195,10 +195,7 @@ if(MINGW)
|
||||
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
|
||||
endif(MINGW)
|
||||
|
||||
-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
-set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
|
||||
-set_target_properties(zlib PROPERTIES SOVERSION 1)
|
||||
|
||||
INSTALL( TARGETS zlibstatic
|
||||
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||
--
|
||||
2.26.0
|
||||
|
||||
@@ -2,6 +2,7 @@ config BR2_PACKAGE_ASSIMP
|
||||
bool "assimp"
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on BR2_USE_WCHAR
|
||||
depends on BR2_PACKAGE_LIBZLIB
|
||||
help
|
||||
Open Asset Import Library (assimp) is a portable Open Source
|
||||
library to import various well-known 3D model formats in a
|
||||
@@ -12,4 +13,8 @@ config BR2_PACKAGE_ASSIMP
|
||||
http://www.assimp.org
|
||||
|
||||
comment "assimp needs a toolchain w/ C++, wchar"
|
||||
depends on BR2_PACKAGE_LIBZLIB
|
||||
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR
|
||||
|
||||
comment "assimp needs libzlib"
|
||||
depends on !BR2_PACKAGE_LIBZLIB
|
||||
|
||||
@@ -8,6 +8,7 @@ ASSIMP_VERSION = 5.0.1
|
||||
ASSIMP_SITE = $(call github,assimp,assimp,v$(ASSIMP_VERSION))
|
||||
ASSIMP_LICENSE = BSD-3-Clause
|
||||
ASSIMP_LICENSE_FILES = LICENSE
|
||||
ASSIMP_DEPENDENCIES = zlib
|
||||
ASSIMP_INSTALL_STAGING = YES
|
||||
|
||||
# relocation truncated to fit: R_68K_GOT16O. We also need to disable
|
||||
@@ -36,7 +37,7 @@ ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
|
||||
ASSIMP_CXXFLAGS += -O0
|
||||
endif
|
||||
|
||||
ASSIMP_CONF_OPTS += -DASSIMP_BUILD_ZLIB=ON -DASSIMP_BUILD_TESTS=OFF \
|
||||
ASSIMP_CONF_OPTS += -DASSIMP_BUILD_TESTS=OFF \
|
||||
-DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) $(ASSIMP_CXXFLAGS)"
|
||||
|
||||
$(eval $(cmake-package))
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
From 93cf62b662499e560812145dd989056fcf14f00e Mon Sep 17 00:00:00 2001
|
||||
From: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
Date: Mon, 22 Mar 2021 13:30:07 +0100
|
||||
Subject: [PATCH] bfd/elf32-or1k: fix ld assert
|
||||
|
||||
Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=27624
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 2f200b197b..ae508540f5 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -2535,11 +2535,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if (h->type == STT_FUNC
|
||||
|| h->needs_plt)
|
||||
{
|
||||
- if (! bfd_link_pic (info)
|
||||
- && !h->def_dynamic
|
||||
- && !h->ref_dynamic
|
||||
- && h->root.type != bfd_link_hash_undefweak
|
||||
- && h->root.type != bfd_link_hash_undefined)
|
||||
+ if (h->plt.refcount <= 0
|
||||
+ || (SYMBOL_CALLS_LOCAL (info, h)
|
||||
+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|
||||
+ && h->root.type == bfd_link_hash_undefweak)))
|
||||
{
|
||||
/* This case can occur if we saw a PLT reloc in an input
|
||||
file, but the symbol was never referred to by a dynamic
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
From 788cda9f9447e0fe67e582e8fb5adafd678d08b2 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:14 +0900
|
||||
Subject: [PATCH] or1k: Fix issue with plt link failure for local calls
|
||||
|
||||
When building protobuf we were seeing the assert failure:
|
||||
|
||||
/home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
|
||||
BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
|
||||
/home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
|
||||
BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
|
||||
/home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
|
||||
BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
|
||||
collect2: error: ld returned 1 exit status
|
||||
|
||||
This failure happens while writing out PLT entries, there is a check
|
||||
"BFD_ASSERT (h->dynindx != -1)" to confirm all plt entries have dynamic
|
||||
symbol attributes. This was failing for symbols that were
|
||||
"forced_local" in previous linking code.
|
||||
|
||||
The fix adds logic to or1k_elf_adjust_dynamic_symbol to identify
|
||||
"forced_local" symbols and exclude them from the the PLT.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 27624
|
||||
* elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Change
|
||||
condition used to cleanup plt entries to cleanup forced local
|
||||
entries.
|
||||
|
||||
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 2f200b197b8..1f2c88b0b3a 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -2535,11 +2535,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if (h->type == STT_FUNC
|
||||
|| h->needs_plt)
|
||||
{
|
||||
- if (! bfd_link_pic (info)
|
||||
- && !h->def_dynamic
|
||||
- && !h->ref_dynamic
|
||||
- && h->root.type != bfd_link_hash_undefweak
|
||||
- && h->root.type != bfd_link_hash_undefined)
|
||||
+ if (h->plt.refcount <= 0
|
||||
+ || (SYMBOL_CALLS_LOCAL (info, h)
|
||||
+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|
||||
+ && h->root.type == bfd_link_hash_undefweak)))
|
||||
{
|
||||
/* This case can occur if we saw a PLT reloc in an input
|
||||
file, but the symbol was never referred to by a dynamic
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+256
@@ -0,0 +1,256 @@
|
||||
From b10e6230dea0015bf3b7748580b82c551f9a3a4a Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:15 +0900
|
||||
Subject: [PATCH] or1k: Implement relocation R_OR1K_GOT_AHI16 for gotha()
|
||||
|
||||
The gotha() relocation mnemonic will be outputted by OpenRISC GCC when
|
||||
using the -mcmodel=large option. This relocation is used along with
|
||||
got() to generate 32-bit GOT offsets. This increases the previous GOT
|
||||
offset limit from the previous 16-bit (64K) limit.
|
||||
|
||||
This is needed on large binaries where the GOT grows larger than 64k.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* bfd-in2.h: Add BFD_RELOC_OR1K_GOT_AHI16 relocation.
|
||||
* elf32-or1k.c (or1k_elf_howto_table, or1k_reloc_map): Likewise.
|
||||
(or1k_final_link_relocate, or1k_elf_relocate_section,
|
||||
or1k_elf_check_relocs): Likewise.
|
||||
* libbfd.h (bfd_reloc_code_real_names): Likewise.
|
||||
* reloc.c: Likewise.
|
||||
|
||||
cpu/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* or1k.opc (or1k_imm16_relocs, parse_reloc): Define parse logic
|
||||
for gotha() relocation.
|
||||
|
||||
include/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* elf/or1k.h (elf_or1k_reloc_type): Define R_OR1K_GOT_AHI16 number.
|
||||
|
||||
opcodes/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* or1k-asm.c: Regenerate.
|
||||
|
||||
gas/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* testsuite/gas/or1k/reloc-1.s: Add test for new relocation.
|
||||
* testsuite/gas/or1k/reloc-1.d: Add test result for new
|
||||
relocation.
|
||||
|
||||
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
|
||||
fixup reloc, add tests
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/bfd-in2.h | 1 +
|
||||
bfd/elf32-or1k.c | 21 ++++++++++++++++++++-
|
||||
bfd/libbfd.h | 1 +
|
||||
bfd/reloc.c | 2 ++
|
||||
cpu/or1k.opc | 7 ++++++-
|
||||
gas/testsuite/gas/or1k/reloc-1.d | 4 +++-
|
||||
gas/testsuite/gas/or1k/reloc-1.s | 4 ++++
|
||||
include/elf/or1k.h | 1 +
|
||||
opcodes/or1k-asm.c | 7 ++++++-
|
||||
9 files changed, 44 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
|
||||
index e25da50aafb..530a41fca43 100644
|
||||
--- a/bfd/bfd-in2.h
|
||||
+++ b/bfd/bfd-in2.h
|
||||
@@ -5517,6 +5517,7 @@ then it may be truncated to 8 bits. */
|
||||
BFD_RELOC_OR1K_TLS_TPOFF,
|
||||
BFD_RELOC_OR1K_TLS_DTPOFF,
|
||||
BFD_RELOC_OR1K_TLS_DTPMOD,
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16,
|
||||
|
||||
/* H8 elf Relocations. */
|
||||
BFD_RELOC_H8_DIR16A8,
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 1f2c88b0b3a..a4a64f73b7c 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -808,6 +808,20 @@ static reloc_howto_type or1k_elf_howto_table[] =
|
||||
0, /* Source Mask. */
|
||||
0x03ffffff, /* Dest Mask. */
|
||||
TRUE), /* PC relative offset? */
|
||||
+
|
||||
+ HOWTO (R_OR1K_GOT_AHI16, /* type */
|
||||
+ 16, /* rightshift */
|
||||
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
+ 16, /* bitsize */
|
||||
+ FALSE, /* pc_relative */
|
||||
+ 0, /* bitpos */
|
||||
+ complain_overflow_signed, /* complain_on_overflow */
|
||||
+ bfd_elf_generic_reloc, /* special_function */
|
||||
+ "R_OR1K_GOT_AHI16", /* name */
|
||||
+ FALSE, /* partial_inplace */
|
||||
+ 0, /* src_mask */
|
||||
+ 0xffff, /* dst_mask */
|
||||
+ FALSE), /* pcrel_offset */
|
||||
};
|
||||
|
||||
/* Map BFD reloc types to Or1k ELF reloc types. */
|
||||
@@ -871,6 +885,7 @@ static const struct or1k_reloc_map or1k_reloc_map[] =
|
||||
{ BFD_RELOC_OR1K_TLS_IE_LO13, R_OR1K_TLS_IE_LO13 },
|
||||
{ BFD_RELOC_OR1K_SLO13, R_OR1K_SLO13 },
|
||||
{ BFD_RELOC_OR1K_PLTA26, R_OR1K_PLTA26 },
|
||||
+ { BFD_RELOC_OR1K_GOT_AHI16, R_OR1K_GOT_AHI16 },
|
||||
};
|
||||
|
||||
#define TLS_UNKNOWN 0
|
||||
@@ -1080,6 +1095,7 @@ or1k_final_link_relocate (reloc_howto_type *howto, bfd *input_bfd,
|
||||
switch (howto->type)
|
||||
{
|
||||
case R_OR1K_AHI16:
|
||||
+ case R_OR1K_GOT_AHI16:
|
||||
case R_OR1K_GOTOFF_AHI16:
|
||||
case R_OR1K_TLS_IE_AHI16:
|
||||
case R_OR1K_TLS_LE_AHI16:
|
||||
@@ -1344,6 +1360,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
}
|
||||
break;
|
||||
|
||||
+ case R_OR1K_GOT_AHI16:
|
||||
case R_OR1K_GOT16:
|
||||
case R_OR1K_GOT_PG21:
|
||||
case R_OR1K_GOT_LO13:
|
||||
@@ -1435,7 +1452,8 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
/* The GOT_PG21 and GOT_LO13 relocs are pc-relative,
|
||||
while the GOT16 reloc is GOT relative. */
|
||||
relocation = got_base + off;
|
||||
- if (r_type == R_OR1K_GOT16)
|
||||
+ if (r_type == R_OR1K_GOT16
|
||||
+ || r_type == R_OR1K_GOT_AHI16)
|
||||
relocation -= got_sym_value;
|
||||
|
||||
/* Addend should be zero. */
|
||||
@@ -1945,6 +1963,7 @@ or1k_elf_check_relocs (bfd *abfd,
|
||||
}
|
||||
break;
|
||||
|
||||
+ case R_OR1K_GOT_AHI16:
|
||||
case R_OR1K_GOT16:
|
||||
case R_OR1K_GOT_PG21:
|
||||
case R_OR1K_GOT_LO13:
|
||||
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
|
||||
index 36284d71a9b..6e9e3190bb8 100644
|
||||
--- a/bfd/libbfd.h
|
||||
+++ b/bfd/libbfd.h
|
||||
@@ -2702,6 +2702,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
|
||||
"BFD_RELOC_OR1K_TLS_TPOFF",
|
||||
"BFD_RELOC_OR1K_TLS_DTPOFF",
|
||||
"BFD_RELOC_OR1K_TLS_DTPMOD",
|
||||
+ "BFD_RELOC_OR1K_GOT_AHI16",
|
||||
"BFD_RELOC_H8_DIR16A8",
|
||||
"BFD_RELOC_H8_DIR16R8",
|
||||
"BFD_RELOC_H8_DIR24A8",
|
||||
diff --git a/bfd/reloc.c b/bfd/reloc.c
|
||||
index e6446a78098..b0003ab1175 100644
|
||||
--- a/bfd/reloc.c
|
||||
+++ b/bfd/reloc.c
|
||||
@@ -6164,6 +6164,8 @@ ENUMX
|
||||
BFD_RELOC_OR1K_GOTPC_HI16
|
||||
ENUMX
|
||||
BFD_RELOC_OR1K_GOTPC_LO16
|
||||
+ENUMX
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16
|
||||
ENUMX
|
||||
BFD_RELOC_OR1K_GOT16
|
||||
ENUMX
|
||||
diff --git a/cpu/or1k.opc b/cpu/or1k.opc
|
||||
index 5082a30cee1..85163fc96c9 100644
|
||||
--- a/cpu/or1k.opc
|
||||
+++ b/cpu/or1k.opc
|
||||
@@ -173,7 +173,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
|
||||
BFD_RELOC_OR1K_GOT_LO13,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
- BFD_RELOC_UNUSED },
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16 },
|
||||
{ BFD_RELOC_OR1K_GOTPC_LO16,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
@@ -276,6 +276,11 @@ parse_reloc (const char **strp)
|
||||
str += 5;
|
||||
cls = RCLASS_TPOFF;
|
||||
}
|
||||
+ else if (strncasecmp (str, "got", 3) == 0)
|
||||
+ {
|
||||
+ str += 3;
|
||||
+ cls = RCLASS_GOT;
|
||||
+ }
|
||||
|
||||
if (strncasecmp (str, "hi(", 3) == 0)
|
||||
{
|
||||
diff --git a/gas/testsuite/gas/or1k/reloc-1.d b/gas/testsuite/gas/or1k/reloc-1.d
|
||||
index d1bcf5608bb..3a001c4ed99 100644
|
||||
--- a/gas/testsuite/gas/or1k/reloc-1.d
|
||||
+++ b/gas/testsuite/gas/or1k/reloc-1.d
|
||||
@@ -68,5 +68,7 @@ OFFSET TYPE VALUE
|
||||
000000ec R_OR1K_LO13 x
|
||||
000000f0 R_OR1K_GOT_LO13 x
|
||||
000000f4 R_OR1K_SLO13 x
|
||||
-
|
||||
+000000f8 R_OR1K_GOT_AHI16 x
|
||||
+000000fc R_OR1K_GOT_AHI16 x
|
||||
+00000100 R_OR1K_GOT_AHI16 x
|
||||
|
||||
diff --git a/gas/testsuite/gas/or1k/reloc-1.s b/gas/testsuite/gas/or1k/reloc-1.s
|
||||
index e76abef6532..562609aa869 100644
|
||||
--- a/gas/testsuite/gas/or1k/reloc-1.s
|
||||
+++ b/gas/testsuite/gas/or1k/reloc-1.s
|
||||
@@ -74,3 +74,7 @@
|
||||
l.lbz r5,po(x)(r3)
|
||||
l.lbz r5,gotpo(x)(r3)
|
||||
l.sb po(x)(r3),r6
|
||||
+
|
||||
+ l.movhi r4,gotha(x)
|
||||
+ l.ori r3,r4,gotha(x)
|
||||
+ l.addi r3,r4,gotha(x)
|
||||
diff --git a/include/elf/or1k.h b/include/elf/or1k.h
|
||||
index 0abef046202..7db3cad18eb 100644
|
||||
--- a/include/elf/or1k.h
|
||||
+++ b/include/elf/or1k.h
|
||||
@@ -77,6 +77,7 @@ START_RELOC_NUMBERS (elf_or1k_reloc_type)
|
||||
RELOC_NUMBER (R_OR1K_TLS_IE_LO13, 51)
|
||||
RELOC_NUMBER (R_OR1K_SLO13, 52)
|
||||
RELOC_NUMBER (R_OR1K_PLTA26, 53)
|
||||
+ RELOC_NUMBER (R_OR1K_GOT_AHI16, 54)
|
||||
END_RELOC_NUMBERS (R_OR1K_max)
|
||||
|
||||
#define EF_OR1K_NODELAY (1UL << 0)
|
||||
diff --git a/opcodes/or1k-asm.c b/opcodes/or1k-asm.c
|
||||
index 7d058d03f5f..332f4b7a9b5 100644
|
||||
--- a/opcodes/or1k-asm.c
|
||||
+++ b/opcodes/or1k-asm.c
|
||||
@@ -177,7 +177,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
|
||||
BFD_RELOC_OR1K_GOT_LO13,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
- BFD_RELOC_UNUSED },
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16 },
|
||||
{ BFD_RELOC_OR1K_GOTPC_LO16,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
@@ -280,6 +280,11 @@ parse_reloc (const char **strp)
|
||||
str += 5;
|
||||
cls = RCLASS_TPOFF;
|
||||
}
|
||||
+ else if (strncasecmp (str, "got", 3) == 0)
|
||||
+ {
|
||||
+ str += 3;
|
||||
+ cls = RCLASS_GOT;
|
||||
+ }
|
||||
|
||||
if (strncasecmp (str, "hi(", 3) == 0)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
From 0f61f76454a9420f158f626cb09a4fbc08c3709e Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:16 +0900
|
||||
Subject: [PATCH] or1k: Avoid R_OR1K_GOT16 overflow failures in presence
|
||||
of R_OR1K_GOT_AHI16
|
||||
|
||||
Now that we support R_OR1K_GOT_AHI16 we can relax the R_OR1K_GOT16
|
||||
overflow validation check if the section has R_OR1K_GOT_AHI16.
|
||||
|
||||
We cannot simple disable R_OR1K_GOT16 overflow validation as there will
|
||||
still be binaries that will have only R_OR1K_GOT16. The
|
||||
R_OR1K_GOT_AHI16 relocation will only be added by GCC when building with
|
||||
the option -mcmodel=large.
|
||||
|
||||
This assumes that R_OR1K_GOT_AHI16 will come before R_OR1K_GOT16, which
|
||||
is the code pattern that will be emitted by GCC.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* elf32-or1k.c (or1k_elf_relocate_section): Relax R_OR1K_GOT16
|
||||
overflow check if we have R_OR1K_GOT_AHI16 followed by
|
||||
R_OR1K_GOT16.
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index a4a64f73b7c..07fff3602a3 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -1248,6 +1248,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
asection *sgot, *splt;
|
||||
bfd_vma plt_base, got_base, got_sym_value;
|
||||
bfd_boolean ret_val = TRUE;
|
||||
+ bfd_boolean saw_gotha = FALSE;
|
||||
|
||||
if (htab == NULL)
|
||||
return FALSE;
|
||||
@@ -1456,6 +1457,16 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
|| r_type == R_OR1K_GOT_AHI16)
|
||||
relocation -= got_sym_value;
|
||||
|
||||
+ if (r_type == R_OR1K_GOT_AHI16)
|
||||
+ saw_gotha = TRUE;
|
||||
+
|
||||
+ /* If we have a R_OR1K_GOT16 followed by a R_OR1K_GOT_AHI16
|
||||
+ relocation we assume the code is doing the right thing to avoid
|
||||
+ overflows. Here we mask the lower 16-bit of the relocation to
|
||||
+ avoid overflow validation failures. */
|
||||
+ if (r_type == R_OR1K_GOT16 && saw_gotha)
|
||||
+ relocation &= 0xffff;
|
||||
+
|
||||
/* Addend should be zero. */
|
||||
if (rel->r_addend != 0)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+500
@@ -0,0 +1,500 @@
|
||||
From 36c7de7ef77ab0c30cb33e2c7ea7a6f4e3052c73 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:17 +0900
|
||||
Subject: [PATCH] or1k: Support large plt_relocs when generating plt
|
||||
entries
|
||||
|
||||
The current PLT generation code will generate invalid code when the PLT
|
||||
relocation offset exceeds 64k. This fixes the issue by detecting large
|
||||
plt_reloc offsets and generare code sequences to create larger plt
|
||||
relocations.
|
||||
|
||||
The "large" plt code needs 2 extra instructions to create 32-bit offsets.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 27746
|
||||
* elf32-or1k.c (PLT_ENTRY_SIZE_LARGE, PLT_MAX_INSN_COUNT,
|
||||
OR1K_ADD, OR1K_ORI): New macros to help with plt creation.
|
||||
(elf_or1k_link_hash_table): New field plt_count.
|
||||
(elf_or1k_link_hash_entry): New field plt_index.
|
||||
(elf_or1k_plt_entry_size): New function.
|
||||
(or1k_write_plt_entry): Update to support variable size PLTs.
|
||||
(or1k_elf_finish_dynamic_sections): Use new or1k_write_plt_entry
|
||||
API.
|
||||
(or1k_elf_finish_dynamic_symbol): Update to write large PLTs
|
||||
when needed.
|
||||
(allocate_dynrelocs): Use elf_or1k_plt_entry_size to account for
|
||||
PLT size.
|
||||
|
||||
ld/ChangeLog:
|
||||
|
||||
PR 27746
|
||||
testsuite/ld-or1k/or1k.exp (or1kplttests): Add tests for linking
|
||||
along with gotha() relocations.
|
||||
testsuite/ld-or1k/gotha1.dd: New file.
|
||||
testsuite/ld-or1k/gotha1.s: New file.
|
||||
testsuite/ld-or1k/gotha2.dd: New file.
|
||||
testsuite/ld-or1k/gotha2.s: New file
|
||||
testsuite/ld-or1k/pltlib.s (x): Define size to avoid link
|
||||
failure.
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 149 ++++++++++++++++++++++++---------
|
||||
ld/testsuite/ld-or1k/gotha1.dd | 34 ++++++++
|
||||
ld/testsuite/ld-or1k/gotha1.s | 24 ++++++
|
||||
ld/testsuite/ld-or1k/gotha2.dd | 21 +++++
|
||||
ld/testsuite/ld-or1k/gotha2.s | 22 +++++
|
||||
ld/testsuite/ld-or1k/or1k.exp | 8 ++
|
||||
ld/testsuite/ld-or1k/pltlib.s | 1 +
|
||||
7 files changed, 220 insertions(+), 39 deletions(-)
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha1.dd
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha1.s
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha2.dd
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha2.s
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 07fff3602a3..fcebbe5f23a 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -30,10 +30,14 @@
|
||||
#define N_ONES(X) (((bfd_vma)2 << (X)) - 1)
|
||||
|
||||
#define PLT_ENTRY_SIZE 16
|
||||
+#define PLT_ENTRY_SIZE_LARGE (6*4)
|
||||
+#define PLT_MAX_INSN_COUNT 6
|
||||
|
||||
#define OR1K_MOVHI(D) (0x18000000 | (D << 21))
|
||||
#define OR1K_ADRP(D) (0x08000000 | (D << 21))
|
||||
#define OR1K_LWZ(D,A) (0x84000000 | (D << 21) | (A << 16))
|
||||
+#define OR1K_ADD(D,A,B) (0xE0000000 | (D << 21) | (A << 16) | (B << 11))
|
||||
+#define OR1K_ORI(D,A) (0xA8000000 | (D << 21) | (A << 16))
|
||||
#define OR1K_ORI0(D) (0xA8000000 | (D << 21))
|
||||
#define OR1K_JR(B) (0x44000000 | (B << 11))
|
||||
#define OR1K_NOP 0x15000000
|
||||
@@ -903,6 +907,8 @@ struct elf_or1k_link_hash_entry
|
||||
/* Track dynamic relocs copied for this symbol. */
|
||||
struct elf_dyn_relocs *dyn_relocs;
|
||||
|
||||
+ /* For calculating PLT size. */
|
||||
+ bfd_vma plt_index;
|
||||
/* Track type of TLS access. */
|
||||
unsigned char tls_type;
|
||||
};
|
||||
@@ -930,9 +936,20 @@ struct elf_or1k_link_hash_table
|
||||
/* Small local sym to section mapping cache. */
|
||||
struct sym_cache sym_sec;
|
||||
|
||||
+ bfd_vma plt_count;
|
||||
bfd_boolean saw_plta;
|
||||
};
|
||||
|
||||
+static size_t
|
||||
+elf_or1k_plt_entry_size (bfd_vma plt_index)
|
||||
+{
|
||||
+ bfd_vma plt_reloc;
|
||||
+
|
||||
+ plt_reloc = plt_index * sizeof (Elf32_External_Rela);
|
||||
+
|
||||
+ return (plt_reloc > 0xffff) ? PLT_ENTRY_SIZE_LARGE : PLT_ENTRY_SIZE;
|
||||
+}
|
||||
+
|
||||
/* Get the ELF linker hash table from a link_info structure. */
|
||||
#define or1k_elf_hash_table(p) \
|
||||
(elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
|
||||
@@ -2176,33 +2193,46 @@ or1k_elf_check_relocs (bfd *abfd,
|
||||
}
|
||||
|
||||
static void
|
||||
-or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insn1,
|
||||
- unsigned insn2, unsigned insn3, unsigned insnj)
|
||||
+or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
|
||||
+ unsigned insns[], size_t insn_count)
|
||||
{
|
||||
unsigned nodelay = elf_elfheader (output_bfd)->e_flags & EF_OR1K_NODELAY;
|
||||
- unsigned insn4;
|
||||
+ unsigned output_insns[PLT_MAX_INSN_COUNT];
|
||||
+
|
||||
+ /* Copy instructions into the output buffer. */
|
||||
+ for (size_t i = 0; i < insn_count; i++)
|
||||
+ output_insns[i] = insns[i];
|
||||
|
||||
/* Honor the no-delay-slot setting. */
|
||||
- if (insn3 == OR1K_NOP)
|
||||
+ if (insns[insn_count-1] == OR1K_NOP)
|
||||
{
|
||||
- insn4 = insn3;
|
||||
+ unsigned slot1, slot2;
|
||||
+
|
||||
if (nodelay)
|
||||
- insn3 = insnj;
|
||||
+ slot1 = insns[insn_count-2], slot2 = insnj;
|
||||
else
|
||||
- insn3 = insn2, insn2 = insnj;
|
||||
+ slot1 = insnj, slot2 = insns[insn_count-2];
|
||||
+
|
||||
+ output_insns[insn_count-2] = slot1;
|
||||
+ output_insns[insn_count-1] = slot2;
|
||||
+ output_insns[insn_count] = OR1K_NOP;
|
||||
}
|
||||
else
|
||||
{
|
||||
+ unsigned slot1, slot2;
|
||||
+
|
||||
if (nodelay)
|
||||
- insn4 = insnj;
|
||||
+ slot1 = insns[insn_count-1], slot2 = insnj;
|
||||
else
|
||||
- insn4 = insn3, insn3 = insnj;
|
||||
+ slot1 = insnj, slot2 = insns[insn_count-1];
|
||||
+
|
||||
+ output_insns[insn_count-1] = slot1;
|
||||
+ output_insns[insn_count] = slot2;
|
||||
}
|
||||
|
||||
- bfd_put_32 (output_bfd, insn1, contents);
|
||||
- bfd_put_32 (output_bfd, insn2, contents + 4);
|
||||
- bfd_put_32 (output_bfd, insn3, contents + 8);
|
||||
- bfd_put_32 (output_bfd, insn4, contents + 12);
|
||||
+ /* Write out the output buffer. */
|
||||
+ for (size_t i = 0; i < (insn_count+1); i++)
|
||||
+ bfd_put_32 (output_bfd, output_insns[i], contents + (i*4));
|
||||
}
|
||||
|
||||
/* Finish up the dynamic sections. */
|
||||
@@ -2269,7 +2299,8 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
|
||||
splt = htab->root.splt;
|
||||
if (splt && splt->size > 0)
|
||||
{
|
||||
- unsigned plt0, plt1, plt2;
|
||||
+ unsigned plt[PLT_MAX_INSN_COUNT];
|
||||
+ size_t plt_insn_count = 3;
|
||||
bfd_vma got_addr = sgot->output_section->vma + sgot->output_offset;
|
||||
|
||||
/* Note we force 16 byte alignment on the .got, so that
|
||||
@@ -2280,27 +2311,27 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
|
||||
bfd_vma pc = splt->output_section->vma + splt->output_offset;
|
||||
unsigned pa = ((got_addr >> 13) - (pc >> 13)) & 0x1fffff;
|
||||
unsigned po = got_addr & 0x1fff;
|
||||
- plt0 = OR1K_ADRP(12) | pa;
|
||||
- plt1 = OR1K_LWZ(15,12) | (po + 8);
|
||||
- plt2 = OR1K_LWZ(12,12) | (po + 4);
|
||||
+ plt[0] = OR1K_ADRP(12) | pa;
|
||||
+ plt[1] = OR1K_LWZ(15,12) | (po + 8);
|
||||
+ plt[2] = OR1K_LWZ(12,12) | (po + 4);
|
||||
}
|
||||
else if (bfd_link_pic (info))
|
||||
{
|
||||
- plt0 = OR1K_LWZ(15, 16) | 8; /* .got+8 */
|
||||
- plt1 = OR1K_LWZ(12, 16) | 4; /* .got+4 */
|
||||
- plt2 = OR1K_NOP;
|
||||
+ plt[0] = OR1K_LWZ(15, 16) | 8; /* .got+8 */
|
||||
+ plt[1] = OR1K_LWZ(12, 16) | 4; /* .got+4 */
|
||||
+ plt[2] = OR1K_NOP;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
|
||||
unsigned lo = got_addr & 0xffff;
|
||||
- plt0 = OR1K_MOVHI(12) | ha;
|
||||
- plt1 = OR1K_LWZ(15,12) | (lo + 8);
|
||||
- plt2 = OR1K_LWZ(12,12) | (lo + 4);
|
||||
+ plt[0] = OR1K_MOVHI(12) | ha;
|
||||
+ plt[1] = OR1K_LWZ(15,12) | (lo + 8);
|
||||
+ plt[2] = OR1K_LWZ(12,12) | (lo + 4);
|
||||
}
|
||||
|
||||
- or1k_write_plt_entry (output_bfd, splt->contents,
|
||||
- plt0, plt1, plt2, OR1K_JR(15));
|
||||
+ or1k_write_plt_entry (output_bfd, splt->contents, OR1K_JR(15),
|
||||
+ plt, plt_insn_count);
|
||||
|
||||
elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
|
||||
}
|
||||
@@ -2343,7 +2374,8 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
|
||||
if (h->plt.offset != (bfd_vma) -1)
|
||||
{
|
||||
- unsigned int plt0, plt1, plt2;
|
||||
+ unsigned int plt[PLT_MAX_INSN_COUNT];
|
||||
+ size_t plt_insn_count = 3;
|
||||
asection *splt;
|
||||
asection *sgot;
|
||||
asection *srela;
|
||||
@@ -2355,6 +2387,7 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
bfd_vma got_offset;
|
||||
bfd_vma got_addr;
|
||||
Elf_Internal_Rela rela;
|
||||
+ bfd_boolean large_plt_entry;
|
||||
|
||||
/* This symbol has an entry in the procedure linkage table. Set
|
||||
it up. */
|
||||
@@ -2372,10 +2405,13 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
corresponds to this symbol. This is the index of this symbol
|
||||
in all the symbols for which we are making plt entries. The
|
||||
first entry in the procedure linkage table is reserved. */
|
||||
- plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
|
||||
+ plt_index = ((struct elf_or1k_link_hash_entry *) h)->plt_index;
|
||||
plt_addr = plt_base_addr + h->plt.offset;
|
||||
plt_reloc = plt_index * sizeof (Elf32_External_Rela);
|
||||
|
||||
+ large_plt_entry = (elf_or1k_plt_entry_size (plt_index)
|
||||
+ == PLT_ENTRY_SIZE_LARGE);
|
||||
+
|
||||
/* Get the offset into the .got table of the entry that
|
||||
corresponds to this function. Each .got entry is 4 bytes.
|
||||
The first three are reserved. */
|
||||
@@ -2387,27 +2423,57 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
{
|
||||
unsigned pa = ((got_addr >> 13) - (plt_addr >> 13)) & 0x1fffff;
|
||||
unsigned po = (got_addr & 0x1fff);
|
||||
- plt0 = OR1K_ADRP(12) | pa;
|
||||
- plt1 = OR1K_LWZ(12,12) | po;
|
||||
- plt2 = OR1K_ORI0(11) | plt_reloc;
|
||||
+ plt[0] = OR1K_ADRP(12) | pa;
|
||||
+ plt[1] = OR1K_LWZ(12,12) | po;
|
||||
+ plt[2] = OR1K_ORI0(11) | plt_reloc;
|
||||
}
|
||||
else if (bfd_link_pic (info))
|
||||
{
|
||||
- plt0 = OR1K_LWZ(12,16) | got_offset;
|
||||
- plt1 = OR1K_ORI0(11) | plt_reloc;
|
||||
- plt2 = OR1K_NOP;
|
||||
+ if (large_plt_entry)
|
||||
+ {
|
||||
+ unsigned gotha = ((got_offset + 0x8000) >> 16) & 0xffff;
|
||||
+ unsigned got = got_offset & 0xffff;
|
||||
+ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
|
||||
+ unsigned pltrello = plt_reloc & 0xffff;
|
||||
+
|
||||
+ plt[0] = OR1K_MOVHI(12) | gotha;
|
||||
+ plt[1] = OR1K_ADD(12,12,16);
|
||||
+ plt[2] = OR1K_LWZ(12,12) | got;
|
||||
+ plt[3] = OR1K_MOVHI(11) | pltrelhi;
|
||||
+ plt[4] = OR1K_ORI(11,11) | pltrello;
|
||||
+ plt_insn_count = 5;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ plt[0] = OR1K_LWZ(12,16) | got_offset;
|
||||
+ plt[1] = OR1K_ORI0(11) | plt_reloc;
|
||||
+ plt[2] = OR1K_NOP;
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
|
||||
unsigned lo = got_addr & 0xffff;
|
||||
- plt0 = OR1K_MOVHI(12) | ha;
|
||||
- plt1 = OR1K_LWZ(12,12) | lo;
|
||||
- plt2 = OR1K_ORI0(11) | plt_reloc;
|
||||
+ plt[0] = OR1K_MOVHI(12) | ha;
|
||||
+ plt[1] = OR1K_LWZ(12,12) | lo;
|
||||
+ plt[2] = OR1K_ORI0(11) | plt_reloc;
|
||||
+ }
|
||||
+
|
||||
+ /* For large code model we fixup the non-PIC PLT relocation instructions
|
||||
+ here. */
|
||||
+ if (large_plt_entry && !bfd_link_pic (info))
|
||||
+ {
|
||||
+ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
|
||||
+ unsigned pltrello = plt_reloc & 0xffff;
|
||||
+
|
||||
+ plt[2] = OR1K_MOVHI(11) | pltrelhi;
|
||||
+ plt[3] = OR1K_ORI(11,11) | pltrello;
|
||||
+ plt[4] = OR1K_NOP;
|
||||
+ plt_insn_count = 5;
|
||||
}
|
||||
|
||||
or1k_write_plt_entry (output_bfd, splt->contents + h->plt.offset,
|
||||
- plt0, plt1, plt2, OR1K_JR(12));
|
||||
+ OR1K_JR(12), plt, plt_insn_count);
|
||||
|
||||
/* Fill in the entry in the global offset table. */
|
||||
bfd_put_32 (output_bfd, plt_addr, sgot->contents + got_offset);
|
||||
@@ -2699,11 +2765,16 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
|
||||
{
|
||||
asection *s = htab->root.splt;
|
||||
+ bfd_vma plt_index;
|
||||
+
|
||||
+ /* Track the index of our plt entry for use in calculating size. */
|
||||
+ plt_index = htab->plt_count++;
|
||||
+ ((struct elf_or1k_link_hash_entry *) h)->plt_index = plt_index;
|
||||
|
||||
/* If this is the first .plt entry, make room for the special
|
||||
first entry. */
|
||||
if (s->size == 0)
|
||||
- s->size = PLT_ENTRY_SIZE;
|
||||
+ s->size = elf_or1k_plt_entry_size (plt_index);
|
||||
|
||||
h->plt.offset = s->size;
|
||||
|
||||
@@ -2720,7 +2791,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
}
|
||||
|
||||
/* Make room for this entry. */
|
||||
- s->size += PLT_ENTRY_SIZE;
|
||||
+ s->size += elf_or1k_plt_entry_size (plt_index);
|
||||
|
||||
/* We also need to make an entry in the .got.plt section, which
|
||||
will be placed in the .got section by the linker script. */
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha1.dd b/ld/testsuite/ld-or1k/gotha1.dd
|
||||
new file mode 100644
|
||||
index 00000000000..0ad1f8f5399
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha1.dd
|
||||
@@ -0,0 +1,34 @@
|
||||
+
|
||||
+.*\.x: file format elf32-or1k
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.plt:
|
||||
+
|
||||
+[0-9a-f]+ <\.plt>:
|
||||
+ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
|
||||
+ +[0-9a-f]+: 85 ec [0-9a-f]+ [0-9a-f]+ l\.lwz r15,[0-9]+\(r12\)
|
||||
+ +[0-9a-f]+: 44 00 78 00 l\.jr r15
|
||||
+ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
|
||||
+ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
|
||||
+ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
|
||||
+ +[0-9a-f]+: 44 00 60 00 l\.jr r12
|
||||
+ +[0-9a-f]+: a9 60 00 00 l\.ori r11,r0,0x0
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+[0-9a-f]+ <_start>:
|
||||
+ +[0-9a-f]+: 9c 21 ff fc l\.addi r1,r1,-4
|
||||
+ +[0-9a-f]+: d4 01 48 00 l\.sw 0\(r1\),r9
|
||||
+ +[0-9a-f]+: 04 00 00 02 l\.jal [0-9a-f]+ <_start\+0x10>
|
||||
+ +[0-9a-f]+: 1a 60 00 00 l\.movhi r19,0x0
|
||||
+ +[0-9a-f]+: aa 73 [0-9a-f]+ [0-9a-f]+ l\.ori r19,r19,0x[0-9a-f]+
|
||||
+ +[0-9a-f]+: e2 73 48 00 l\.add r19,r19,r9
|
||||
+ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
|
||||
+ +[0-9a-f]+: e2 31 98 00 l\.add r17,r17,r19
|
||||
+ +[0-9a-f]+: 86 31 00 10 l\.lwz r17,16\(r17\)
|
||||
+ +[0-9a-f]+: 84 71 00 00 l\.lwz r3,0\(r17\)
|
||||
+ +[0-9a-f]+: 07 ff ff f2 l\.jal [0-9a-f]+ <\.plt\+0x10>
|
||||
+ +[0-9a-f]+: 15 00 00 00 l\.nop 0x0
|
||||
+ +[0-9a-f]+: 85 21 00 00 l\.lwz r9,0\(r1\)
|
||||
+ +[0-9a-f]+: 44 00 48 00 l\.jr r9
|
||||
+ +[0-9a-f]+: 9c 21 00 04 l\.addi r1,r1,4
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha1.s b/ld/testsuite/ld-or1k/gotha1.s
|
||||
new file mode 100644
|
||||
index 00000000000..42b16db425c
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha1.s
|
||||
@@ -0,0 +1,24 @@
|
||||
+ .data
|
||||
+ .p2align 16
|
||||
+
|
||||
+ .text
|
||||
+ .globl _start
|
||||
+_start:
|
||||
+ l.addi r1, r1, -4
|
||||
+ l.sw 0(r1), r9
|
||||
+
|
||||
+ l.jal 8
|
||||
+ l.movhi r19, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
|
||||
+ l.ori r19, r19, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
|
||||
+ l.add r19, r19, r9
|
||||
+
|
||||
+ l.movhi r17, gotha(x)
|
||||
+ l.add r17, r17, r19
|
||||
+ l.lwz r17, got(x)(r17)
|
||||
+ l.lwz r3, 0(r17)
|
||||
+
|
||||
+ l.jal plt(func)
|
||||
+ l.nop
|
||||
+ l.lwz r9, 0(r1)
|
||||
+ l.jr r9
|
||||
+ l.addi r1, r1, 4
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha2.dd b/ld/testsuite/ld-or1k/gotha2.dd
|
||||
new file mode 100644
|
||||
index 00000000000..fe09da5466b
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha2.dd
|
||||
@@ -0,0 +1,21 @@
|
||||
+
|
||||
+.*\.x: file format elf32-or1k
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+[0-9a-f]+ <test>:
|
||||
+ +[0-9a-f]+: 9c 21 ff f8 l\.addi r1,r1,-8
|
||||
+ +[0-9a-f]+: d4 01 80 00 l\.sw 0\(r1\),r16
|
||||
+ +[0-9a-f]+: d4 01 48 04 l\.sw 4\(r1\),r9
|
||||
+ +[0-9a-f]+: 04 00 [0-9a-f]+ [0-9a-f]+ l\.jal [0-9a-f]+ <test\+0x14>
|
||||
+ +[0-9a-f]+: 1a 00 00 00 l\.movhi r16,0x0
|
||||
+ +[0-9a-f]+: aa 10 [0-9a-f]+ [0-9a-f]+ l\.ori r16,r16,0x[0-9a-f]+
|
||||
+ +[0-9a-f]+: e2 10 48 00 l\.add r16,r16,r9
|
||||
+ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
|
||||
+ +[0-9a-f]+: e2 31 80 00 l\.add r17,r17,r16
|
||||
+ +[0-9a-f]+: 86 31 00 0c l\.lwz r17,12\(r17\)
|
||||
+ +[0-9a-f]+: 85 21 00 04 l\.lwz r9,4\(r1\)
|
||||
+ +[0-9a-f]+: 86 01 00 00 l\.lwz r16,0\(r1\)
|
||||
+ +[0-9a-f]+: 44 00 48 00 l\.jr r9
|
||||
+ +[0-9a-f]+: 9c 21 00 08 l\.addi r1,r1,8
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha2.s b/ld/testsuite/ld-or1k/gotha2.s
|
||||
new file mode 100644
|
||||
index 00000000000..164b282f2dd
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha2.s
|
||||
@@ -0,0 +1,22 @@
|
||||
+ .section .text
|
||||
+ .align 4
|
||||
+ .global test
|
||||
+ .type test, @function
|
||||
+test:
|
||||
+ l.addi r1, r1, -8
|
||||
+ l.sw 0(r1), r16
|
||||
+ l.sw 4(r1), r9
|
||||
+
|
||||
+ l.jal 8
|
||||
+ l.movhi r16, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
|
||||
+ l.ori r16, r16, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
|
||||
+ l.add r16, r16, r9
|
||||
+
|
||||
+ l.movhi r17, gotha(i)
|
||||
+ l.add r17, r17, r16
|
||||
+ l.lwz r17, got(i)(r17)
|
||||
+
|
||||
+ l.lwz r9, 4(r1)
|
||||
+ l.lwz r16, 0(r1)
|
||||
+ l.jr r9
|
||||
+ l.addi r1, r1, 8
|
||||
diff --git a/ld/testsuite/ld-or1k/or1k.exp b/ld/testsuite/ld-or1k/or1k.exp
|
||||
index 24cdbe5fbf3..9cebc49b946 100644
|
||||
--- a/ld/testsuite/ld-or1k/or1k.exp
|
||||
+++ b/ld/testsuite/ld-or1k/or1k.exp
|
||||
@@ -53,6 +53,14 @@ set or1kplttests {
|
||||
"" {plt1.s}
|
||||
{{objdump -dr plt1.x.dd}}
|
||||
"plt1.x"}
|
||||
+ {"gotha exec plt" "tmpdir/libpltlib.so" ""
|
||||
+ "" {gotha1.s}
|
||||
+ {{objdump -dr gotha1.dd}}
|
||||
+ "gotha1.x"}
|
||||
+ {"gotha -fpic -shared" "-fpic -shared" ""
|
||||
+ "" {gotha2.s}
|
||||
+ {{objdump -dr gotha2.dd}}
|
||||
+ "gotha2.x"}
|
||||
}
|
||||
|
||||
# Not implemented yet
|
||||
diff --git a/ld/testsuite/ld-or1k/pltlib.s b/ld/testsuite/ld-or1k/pltlib.s
|
||||
index baf76ca1af7..8b4d7ba48fd 100644
|
||||
--- a/ld/testsuite/ld-or1k/pltlib.s
|
||||
+++ b/ld/testsuite/ld-or1k/pltlib.s
|
||||
@@ -1,5 +1,6 @@
|
||||
.section .data
|
||||
.globl x, y
|
||||
+ .size x, 4
|
||||
x: .long 33
|
||||
y: .long 44
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
From 1659226a96b1daecfd08c057d0d5c39309d207ee Mon Sep 17 00:00:00 2001
|
||||
From: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
Date: Mon, 22 Mar 2021 13:30:07 +0100
|
||||
Subject: [PATCH] bfd/elf32-or1k: fix ld assert
|
||||
|
||||
Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=27624
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 65938e5137..41908f8938 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -2566,11 +2566,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if (h->type == STT_FUNC
|
||||
|| h->needs_plt)
|
||||
{
|
||||
- if (! bfd_link_pic (info)
|
||||
- && !h->def_dynamic
|
||||
- && !h->ref_dynamic
|
||||
- && h->root.type != bfd_link_hash_undefweak
|
||||
- && h->root.type != bfd_link_hash_undefined)
|
||||
+ if (h->plt.refcount <= 0
|
||||
+ || (SYMBOL_CALLS_LOCAL (info, h)
|
||||
+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|
||||
+ && h->root.type == bfd_link_hash_undefweak)))
|
||||
{
|
||||
/* This case can occur if we saw a PLT reloc in an input
|
||||
file, but the symbol was never referred to by a dynamic
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
From 651c3617a04a1d1f78e89623b81be7ba32ff59a5 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:14 +0900
|
||||
Subject: [PATCH] or1k: Fix issue with plt link failure for local calls
|
||||
|
||||
When building protobuf we were seeing the assert failure:
|
||||
|
||||
/home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
|
||||
BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
|
||||
/home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
|
||||
BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
|
||||
/home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
|
||||
BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
|
||||
collect2: error: ld returned 1 exit status
|
||||
|
||||
This failure happens while writing out PLT entries, there is a check
|
||||
"BFD_ASSERT (h->dynindx != -1)" to confirm all plt entries have dynamic
|
||||
symbol attributes. This was failing for symbols that were
|
||||
"forced_local" in previous linking code.
|
||||
|
||||
The fix adds logic to or1k_elf_adjust_dynamic_symbol to identify
|
||||
"forced_local" symbols and exclude them from the the PLT.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 27624
|
||||
* elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Change
|
||||
condition used to cleanup plt entries to cleanup forced local
|
||||
entries.
|
||||
|
||||
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 31ef758a926..58246875546 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -2535,11 +2535,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if (h->type == STT_FUNC
|
||||
|| h->needs_plt)
|
||||
{
|
||||
- if (! bfd_link_pic (info)
|
||||
- && !h->def_dynamic
|
||||
- && !h->ref_dynamic
|
||||
- && h->root.type != bfd_link_hash_undefweak
|
||||
- && h->root.type != bfd_link_hash_undefined)
|
||||
+ if (h->plt.refcount <= 0
|
||||
+ || (SYMBOL_CALLS_LOCAL (info, h)
|
||||
+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|
||||
+ && h->root.type == bfd_link_hash_undefweak)))
|
||||
{
|
||||
/* This case can occur if we saw a PLT reloc in an input
|
||||
file, but the symbol was never referred to by a dynamic
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+256
@@ -0,0 +1,256 @@
|
||||
From 5fb945116ba058eb8f032f94ab2e0c71024388ec Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:15 +0900
|
||||
Subject: [PATCH] or1k: Implement relocation R_OR1K_GOT_AHI16 for gotha()
|
||||
|
||||
The gotha() relocation mnemonic will be outputted by OpenRISC GCC when
|
||||
using the -mcmodel=large option. This relocation is used along with
|
||||
got() to generate 32-bit GOT offsets. This increases the previous GOT
|
||||
offset limit from the previous 16-bit (64K) limit.
|
||||
|
||||
This is needed on large binaries where the GOT grows larger than 64k.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* bfd-in2.h: Add BFD_RELOC_OR1K_GOT_AHI16 relocation.
|
||||
* elf32-or1k.c (or1k_elf_howto_table, or1k_reloc_map): Likewise.
|
||||
(or1k_final_link_relocate, or1k_elf_relocate_section,
|
||||
or1k_elf_check_relocs): Likewise.
|
||||
* libbfd.h (bfd_reloc_code_real_names): Likewise.
|
||||
* reloc.c: Likewise.
|
||||
|
||||
cpu/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* or1k.opc (or1k_imm16_relocs, parse_reloc): Define parse logic
|
||||
for gotha() relocation.
|
||||
|
||||
include/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* elf/or1k.h (elf_or1k_reloc_type): Define R_OR1K_GOT_AHI16 number.
|
||||
|
||||
opcodes/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* or1k-asm.c: Regenerate.
|
||||
|
||||
gas/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* testsuite/gas/or1k/reloc-1.s: Add test for new relocation.
|
||||
* testsuite/gas/or1k/reloc-1.d: Add test result for new
|
||||
relocation.
|
||||
|
||||
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
|
||||
fixup reloc, add tests
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/bfd-in2.h | 1 +
|
||||
bfd/elf32-or1k.c | 21 ++++++++++++++++++++-
|
||||
bfd/libbfd.h | 1 +
|
||||
bfd/reloc.c | 2 ++
|
||||
cpu/or1k.opc | 7 ++++++-
|
||||
gas/testsuite/gas/or1k/reloc-1.d | 4 +++-
|
||||
gas/testsuite/gas/or1k/reloc-1.s | 4 ++++
|
||||
include/elf/or1k.h | 1 +
|
||||
opcodes/or1k-asm.c | 7 ++++++-
|
||||
9 files changed, 44 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
|
||||
index 7c13bc8c91a..ae1082a67c2 100644
|
||||
--- a/bfd/bfd-in2.h
|
||||
+++ b/bfd/bfd-in2.h
|
||||
@@ -5017,6 +5017,7 @@ then it may be truncated to 8 bits. */
|
||||
BFD_RELOC_OR1K_TLS_TPOFF,
|
||||
BFD_RELOC_OR1K_TLS_DTPOFF,
|
||||
BFD_RELOC_OR1K_TLS_DTPMOD,
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16,
|
||||
|
||||
/* H8 elf Relocations. */
|
||||
BFD_RELOC_H8_DIR16A8,
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 58246875546..1273fbacb3c 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -808,6 +808,20 @@ static reloc_howto_type or1k_elf_howto_table[] =
|
||||
0, /* Source Mask. */
|
||||
0x03ffffff, /* Dest Mask. */
|
||||
TRUE), /* PC relative offset? */
|
||||
+
|
||||
+ HOWTO (R_OR1K_GOT_AHI16, /* type */
|
||||
+ 16, /* rightshift */
|
||||
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
+ 16, /* bitsize */
|
||||
+ FALSE, /* pc_relative */
|
||||
+ 0, /* bitpos */
|
||||
+ complain_overflow_signed, /* complain_on_overflow */
|
||||
+ bfd_elf_generic_reloc, /* special_function */
|
||||
+ "R_OR1K_GOT_AHI16", /* name */
|
||||
+ FALSE, /* partial_inplace */
|
||||
+ 0, /* src_mask */
|
||||
+ 0xffff, /* dst_mask */
|
||||
+ FALSE), /* pcrel_offset */
|
||||
};
|
||||
|
||||
/* Map BFD reloc types to Or1k ELF reloc types. */
|
||||
@@ -871,6 +885,7 @@ static const struct or1k_reloc_map or1k_reloc_map[] =
|
||||
{ BFD_RELOC_OR1K_TLS_IE_LO13, R_OR1K_TLS_IE_LO13 },
|
||||
{ BFD_RELOC_OR1K_SLO13, R_OR1K_SLO13 },
|
||||
{ BFD_RELOC_OR1K_PLTA26, R_OR1K_PLTA26 },
|
||||
+ { BFD_RELOC_OR1K_GOT_AHI16, R_OR1K_GOT_AHI16 },
|
||||
};
|
||||
|
||||
#define TLS_UNKNOWN 0
|
||||
@@ -1080,6 +1095,7 @@ or1k_final_link_relocate (reloc_howto_type *howto, bfd *input_bfd,
|
||||
switch (howto->type)
|
||||
{
|
||||
case R_OR1K_AHI16:
|
||||
+ case R_OR1K_GOT_AHI16:
|
||||
case R_OR1K_GOTOFF_AHI16:
|
||||
case R_OR1K_TLS_IE_AHI16:
|
||||
case R_OR1K_TLS_LE_AHI16:
|
||||
@@ -1344,6 +1360,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
}
|
||||
break;
|
||||
|
||||
+ case R_OR1K_GOT_AHI16:
|
||||
case R_OR1K_GOT16:
|
||||
case R_OR1K_GOT_PG21:
|
||||
case R_OR1K_GOT_LO13:
|
||||
@@ -1435,7 +1452,8 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
/* The GOT_PG21 and GOT_LO13 relocs are pc-relative,
|
||||
while the GOT16 reloc is GOT relative. */
|
||||
relocation = got_base + off;
|
||||
- if (r_type == R_OR1K_GOT16)
|
||||
+ if (r_type == R_OR1K_GOT16
|
||||
+ || r_type == R_OR1K_GOT_AHI16)
|
||||
relocation -= got_sym_value;
|
||||
|
||||
/* Addend should be zero. */
|
||||
@@ -1943,6 +1961,7 @@ or1k_elf_check_relocs (bfd *abfd,
|
||||
}
|
||||
break;
|
||||
|
||||
+ case R_OR1K_GOT_AHI16:
|
||||
case R_OR1K_GOT16:
|
||||
case R_OR1K_GOT_PG21:
|
||||
case R_OR1K_GOT_LO13:
|
||||
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
|
||||
index d97d4e57a77..9edc71e0558 100644
|
||||
--- a/bfd/libbfd.h
|
||||
+++ b/bfd/libbfd.h
|
||||
@@ -2704,6 +2704,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
|
||||
"BFD_RELOC_OR1K_TLS_TPOFF",
|
||||
"BFD_RELOC_OR1K_TLS_DTPOFF",
|
||||
"BFD_RELOC_OR1K_TLS_DTPMOD",
|
||||
+ "BFD_RELOC_OR1K_GOT_AHI16",
|
||||
"BFD_RELOC_H8_DIR16A8",
|
||||
"BFD_RELOC_H8_DIR16R8",
|
||||
"BFD_RELOC_H8_DIR24A8",
|
||||
diff --git a/bfd/reloc.c b/bfd/reloc.c
|
||||
index 33cd67150cf..f57ad14a501 100644
|
||||
--- a/bfd/reloc.c
|
||||
+++ b/bfd/reloc.c
|
||||
@@ -6175,6 +6175,8 @@ ENUMX
|
||||
BFD_RELOC_OR1K_GOTPC_HI16
|
||||
ENUMX
|
||||
BFD_RELOC_OR1K_GOTPC_LO16
|
||||
+ENUMX
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16
|
||||
ENUMX
|
||||
BFD_RELOC_OR1K_GOT16
|
||||
ENUMX
|
||||
diff --git a/cpu/or1k.opc b/cpu/or1k.opc
|
||||
index f0adcbb00a5..5d20a1f33a7 100644
|
||||
--- a/cpu/or1k.opc
|
||||
+++ b/cpu/or1k.opc
|
||||
@@ -193,7 +193,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
|
||||
BFD_RELOC_OR1K_GOT_LO13,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
- BFD_RELOC_UNUSED },
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16 },
|
||||
{ BFD_RELOC_OR1K_GOTPC_LO16,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
@@ -296,6 +296,11 @@ parse_reloc (const char **strp)
|
||||
str += 5;
|
||||
cls = RCLASS_TPOFF;
|
||||
}
|
||||
+ else if (strncasecmp (str, "got", 3) == 0)
|
||||
+ {
|
||||
+ str += 3;
|
||||
+ cls = RCLASS_GOT;
|
||||
+ }
|
||||
|
||||
if (strncasecmp (str, "hi(", 3) == 0)
|
||||
{
|
||||
diff --git a/gas/testsuite/gas/or1k/reloc-1.d b/gas/testsuite/gas/or1k/reloc-1.d
|
||||
index d1bcf5608bb..3a001c4ed99 100644
|
||||
--- a/gas/testsuite/gas/or1k/reloc-1.d
|
||||
+++ b/gas/testsuite/gas/or1k/reloc-1.d
|
||||
@@ -68,5 +68,7 @@ OFFSET TYPE VALUE
|
||||
000000ec R_OR1K_LO13 x
|
||||
000000f0 R_OR1K_GOT_LO13 x
|
||||
000000f4 R_OR1K_SLO13 x
|
||||
-
|
||||
+000000f8 R_OR1K_GOT_AHI16 x
|
||||
+000000fc R_OR1K_GOT_AHI16 x
|
||||
+00000100 R_OR1K_GOT_AHI16 x
|
||||
|
||||
diff --git a/gas/testsuite/gas/or1k/reloc-1.s b/gas/testsuite/gas/or1k/reloc-1.s
|
||||
index e76abef6532..562609aa869 100644
|
||||
--- a/gas/testsuite/gas/or1k/reloc-1.s
|
||||
+++ b/gas/testsuite/gas/or1k/reloc-1.s
|
||||
@@ -74,3 +74,7 @@
|
||||
l.lbz r5,po(x)(r3)
|
||||
l.lbz r5,gotpo(x)(r3)
|
||||
l.sb po(x)(r3),r6
|
||||
+
|
||||
+ l.movhi r4,gotha(x)
|
||||
+ l.ori r3,r4,gotha(x)
|
||||
+ l.addi r3,r4,gotha(x)
|
||||
diff --git a/include/elf/or1k.h b/include/elf/or1k.h
|
||||
index a215ef5c17e..dff37d875f2 100644
|
||||
--- a/include/elf/or1k.h
|
||||
+++ b/include/elf/or1k.h
|
||||
@@ -77,6 +77,7 @@ START_RELOC_NUMBERS (elf_or1k_reloc_type)
|
||||
RELOC_NUMBER (R_OR1K_TLS_IE_LO13, 51)
|
||||
RELOC_NUMBER (R_OR1K_SLO13, 52)
|
||||
RELOC_NUMBER (R_OR1K_PLTA26, 53)
|
||||
+ RELOC_NUMBER (R_OR1K_GOT_AHI16, 54)
|
||||
END_RELOC_NUMBERS (R_OR1K_max)
|
||||
|
||||
#define EF_OR1K_NODELAY (1UL << 0)
|
||||
diff --git a/opcodes/or1k-asm.c b/opcodes/or1k-asm.c
|
||||
index 4715c4f2826..a72a4e85363 100644
|
||||
--- a/opcodes/or1k-asm.c
|
||||
+++ b/opcodes/or1k-asm.c
|
||||
@@ -177,7 +177,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
|
||||
BFD_RELOC_OR1K_GOT_LO13,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
- BFD_RELOC_UNUSED },
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16 },
|
||||
{ BFD_RELOC_OR1K_GOTPC_LO16,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
@@ -280,6 +280,11 @@ parse_reloc (const char **strp)
|
||||
str += 5;
|
||||
cls = RCLASS_TPOFF;
|
||||
}
|
||||
+ else if (strncasecmp (str, "got", 3) == 0)
|
||||
+ {
|
||||
+ str += 3;
|
||||
+ cls = RCLASS_GOT;
|
||||
+ }
|
||||
|
||||
if (strncasecmp (str, "hi(", 3) == 0)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
From d92116c7df340ff40063c5c97d202e7e87400027 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:16 +0900
|
||||
Subject: [PATCH] or1k: Avoid R_OR1K_GOT16 overflow failures in presence of
|
||||
R_OR1K_GOT_AHI16
|
||||
|
||||
Now that we support R_OR1K_GOT_AHI16 we can relax the R_OR1K_GOT16
|
||||
overflow validation check if the section has R_OR1K_GOT_AHI16.
|
||||
|
||||
We cannot simple disable R_OR1K_GOT16 overflow validation as there will
|
||||
still be binaries that will have only R_OR1K_GOT16. The
|
||||
R_OR1K_GOT_AHI16 relocation will only be added by GCC when building with
|
||||
the option -mcmodel=large.
|
||||
|
||||
This assumes that R_OR1K_GOT_AHI16 will come before R_OR1K_GOT16, which
|
||||
is the code pattern that will be emitted by GCC.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* elf32-or1k.c (or1k_elf_relocate_section): Relax R_OR1K_GOT16
|
||||
overflow check if we have R_OR1K_GOT_AHI16 followed by
|
||||
R_OR1K_GOT16.
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 1273fbacb3c..ce2c4fdb3bd 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -1248,6 +1248,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
asection *sgot, *splt;
|
||||
bfd_vma plt_base, got_base, got_sym_value;
|
||||
bfd_boolean ret_val = TRUE;
|
||||
+ bfd_boolean saw_gotha = FALSE;
|
||||
|
||||
if (htab == NULL)
|
||||
return FALSE;
|
||||
@@ -1456,6 +1457,16 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
|| r_type == R_OR1K_GOT_AHI16)
|
||||
relocation -= got_sym_value;
|
||||
|
||||
+ if (r_type == R_OR1K_GOT_AHI16)
|
||||
+ saw_gotha = TRUE;
|
||||
+
|
||||
+ /* If we have a R_OR1K_GOT16 followed by a R_OR1K_GOT_AHI16
|
||||
+ relocation we assume the code is doing the right thing to avoid
|
||||
+ overflows. Here we mask the lower 16-bit of the relocation to
|
||||
+ avoid overflow validation failures. */
|
||||
+ if (r_type == R_OR1K_GOT16 && saw_gotha)
|
||||
+ relocation &= 0xffff;
|
||||
+
|
||||
/* Addend should be zero. */
|
||||
if (rel->r_addend != 0)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+500
@@ -0,0 +1,500 @@
|
||||
From cba29e387040eaa401c52eb20e7cab5a4401185c Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:17 +0900
|
||||
Subject: [PATCH] or1k: Support large plt_relocs when generating plt
|
||||
entries
|
||||
|
||||
The current PLT generation code will generate invalid code when the PLT
|
||||
relocation offset exceeds 64k. This fixes the issue by detecting large
|
||||
plt_reloc offsets and generare code sequences to create larger plt
|
||||
relocations.
|
||||
|
||||
The "large" plt code needs 2 extra instructions to create 32-bit offsets.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 27746
|
||||
* elf32-or1k.c (PLT_ENTRY_SIZE_LARGE, PLT_MAX_INSN_COUNT,
|
||||
OR1K_ADD, OR1K_ORI): New macros to help with plt creation.
|
||||
(elf_or1k_link_hash_table): New field plt_count.
|
||||
(elf_or1k_link_hash_entry): New field plt_index.
|
||||
(elf_or1k_plt_entry_size): New function.
|
||||
(or1k_write_plt_entry): Update to support variable size PLTs.
|
||||
(or1k_elf_finish_dynamic_sections): Use new or1k_write_plt_entry
|
||||
API.
|
||||
(or1k_elf_finish_dynamic_symbol): Update to write large PLTs
|
||||
when needed.
|
||||
(allocate_dynrelocs): Use elf_or1k_plt_entry_size to account for
|
||||
PLT size.
|
||||
|
||||
ld/ChangeLog:
|
||||
|
||||
PR 27746
|
||||
testsuite/ld-or1k/or1k.exp (or1kplttests): Add tests for linking
|
||||
along with gotha() relocations.
|
||||
testsuite/ld-or1k/gotha1.dd: New file.
|
||||
testsuite/ld-or1k/gotha1.s: New file.
|
||||
testsuite/ld-or1k/gotha2.dd: New file.
|
||||
testsuite/ld-or1k/gotha2.s: New file
|
||||
testsuite/ld-or1k/pltlib.s (x): Define size to avoid link
|
||||
failure.
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 149 ++++++++++++++++++++++++---------
|
||||
ld/testsuite/ld-or1k/gotha1.dd | 34 ++++++++
|
||||
ld/testsuite/ld-or1k/gotha1.s | 24 ++++++
|
||||
ld/testsuite/ld-or1k/gotha2.dd | 21 +++++
|
||||
ld/testsuite/ld-or1k/gotha2.s | 22 +++++
|
||||
ld/testsuite/ld-or1k/or1k.exp | 8 ++
|
||||
ld/testsuite/ld-or1k/pltlib.s | 1 +
|
||||
7 files changed, 220 insertions(+), 39 deletions(-)
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha1.dd
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha1.s
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha2.dd
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha2.s
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index ce2c4fdb3bd..8b021b79d92 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -30,10 +30,14 @@
|
||||
#define N_ONES(X) (((bfd_vma)2 << (X)) - 1)
|
||||
|
||||
#define PLT_ENTRY_SIZE 16
|
||||
+#define PLT_ENTRY_SIZE_LARGE (6*4)
|
||||
+#define PLT_MAX_INSN_COUNT 6
|
||||
|
||||
#define OR1K_MOVHI(D) (0x18000000 | (D << 21))
|
||||
#define OR1K_ADRP(D) (0x08000000 | (D << 21))
|
||||
#define OR1K_LWZ(D,A) (0x84000000 | (D << 21) | (A << 16))
|
||||
+#define OR1K_ADD(D,A,B) (0xE0000000 | (D << 21) | (A << 16) | (B << 11))
|
||||
+#define OR1K_ORI(D,A) (0xA8000000 | (D << 21) | (A << 16))
|
||||
#define OR1K_ORI0(D) (0xA8000000 | (D << 21))
|
||||
#define OR1K_JR(B) (0x44000000 | (B << 11))
|
||||
#define OR1K_NOP 0x15000000
|
||||
@@ -903,6 +907,8 @@ struct elf_or1k_link_hash_entry
|
||||
/* Track dynamic relocs copied for this symbol. */
|
||||
struct elf_dyn_relocs *dyn_relocs;
|
||||
|
||||
+ /* For calculating PLT size. */
|
||||
+ bfd_vma plt_index;
|
||||
/* Track type of TLS access. */
|
||||
unsigned char tls_type;
|
||||
};
|
||||
@@ -930,9 +936,20 @@ struct elf_or1k_link_hash_table
|
||||
/* Small local sym to section mapping cache. */
|
||||
struct sym_cache sym_sec;
|
||||
|
||||
+ bfd_vma plt_count;
|
||||
bfd_boolean saw_plta;
|
||||
};
|
||||
|
||||
+static size_t
|
||||
+elf_or1k_plt_entry_size (bfd_vma plt_index)
|
||||
+{
|
||||
+ bfd_vma plt_reloc;
|
||||
+
|
||||
+ plt_reloc = plt_index * sizeof (Elf32_External_Rela);
|
||||
+
|
||||
+ return (plt_reloc > 0xffff) ? PLT_ENTRY_SIZE_LARGE : PLT_ENTRY_SIZE;
|
||||
+}
|
||||
+
|
||||
/* Get the ELF linker hash table from a link_info structure. */
|
||||
#define or1k_elf_hash_table(p) \
|
||||
(elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
|
||||
@@ -2173,33 +2190,46 @@ or1k_elf_check_relocs (bfd *abfd,
|
||||
}
|
||||
|
||||
static void
|
||||
-or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insn1,
|
||||
- unsigned insn2, unsigned insn3, unsigned insnj)
|
||||
+or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
|
||||
+ unsigned insns[], size_t insn_count)
|
||||
{
|
||||
unsigned nodelay = elf_elfheader (output_bfd)->e_flags & EF_OR1K_NODELAY;
|
||||
- unsigned insn4;
|
||||
+ unsigned output_insns[PLT_MAX_INSN_COUNT];
|
||||
+
|
||||
+ /* Copy instructions into the output buffer. */
|
||||
+ for (size_t i = 0; i < insn_count; i++)
|
||||
+ output_insns[i] = insns[i];
|
||||
|
||||
/* Honor the no-delay-slot setting. */
|
||||
- if (insn3 == OR1K_NOP)
|
||||
+ if (insns[insn_count-1] == OR1K_NOP)
|
||||
{
|
||||
- insn4 = insn3;
|
||||
+ unsigned slot1, slot2;
|
||||
+
|
||||
if (nodelay)
|
||||
- insn3 = insnj;
|
||||
+ slot1 = insns[insn_count-2], slot2 = insnj;
|
||||
else
|
||||
- insn3 = insn2, insn2 = insnj;
|
||||
+ slot1 = insnj, slot2 = insns[insn_count-2];
|
||||
+
|
||||
+ output_insns[insn_count-2] = slot1;
|
||||
+ output_insns[insn_count-1] = slot2;
|
||||
+ output_insns[insn_count] = OR1K_NOP;
|
||||
}
|
||||
else
|
||||
{
|
||||
+ unsigned slot1, slot2;
|
||||
+
|
||||
if (nodelay)
|
||||
- insn4 = insnj;
|
||||
+ slot1 = insns[insn_count-1], slot2 = insnj;
|
||||
else
|
||||
- insn4 = insn3, insn3 = insnj;
|
||||
+ slot1 = insnj, slot2 = insns[insn_count-1];
|
||||
+
|
||||
+ output_insns[insn_count-1] = slot1;
|
||||
+ output_insns[insn_count] = slot2;
|
||||
}
|
||||
|
||||
- bfd_put_32 (output_bfd, insn1, contents);
|
||||
- bfd_put_32 (output_bfd, insn2, contents + 4);
|
||||
- bfd_put_32 (output_bfd, insn3, contents + 8);
|
||||
- bfd_put_32 (output_bfd, insn4, contents + 12);
|
||||
+ /* Write out the output buffer. */
|
||||
+ for (size_t i = 0; i < (insn_count+1); i++)
|
||||
+ bfd_put_32 (output_bfd, output_insns[i], contents + (i*4));
|
||||
}
|
||||
|
||||
/* Finish up the dynamic sections. */
|
||||
@@ -2266,7 +2296,8 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
|
||||
splt = htab->root.splt;
|
||||
if (splt && splt->size > 0)
|
||||
{
|
||||
- unsigned plt0, plt1, plt2;
|
||||
+ unsigned plt[PLT_MAX_INSN_COUNT];
|
||||
+ size_t plt_insn_count = 3;
|
||||
bfd_vma got_addr = sgot->output_section->vma + sgot->output_offset;
|
||||
|
||||
/* Note we force 16 byte alignment on the .got, so that
|
||||
@@ -2277,27 +2308,27 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
|
||||
bfd_vma pc = splt->output_section->vma + splt->output_offset;
|
||||
unsigned pa = ((got_addr >> 13) - (pc >> 13)) & 0x1fffff;
|
||||
unsigned po = got_addr & 0x1fff;
|
||||
- plt0 = OR1K_ADRP(12) | pa;
|
||||
- plt1 = OR1K_LWZ(15,12) | (po + 8);
|
||||
- plt2 = OR1K_LWZ(12,12) | (po + 4);
|
||||
+ plt[0] = OR1K_ADRP(12) | pa;
|
||||
+ plt[1] = OR1K_LWZ(15,12) | (po + 8);
|
||||
+ plt[2] = OR1K_LWZ(12,12) | (po + 4);
|
||||
}
|
||||
else if (bfd_link_pic (info))
|
||||
{
|
||||
- plt0 = OR1K_LWZ(15, 16) | 8; /* .got+8 */
|
||||
- plt1 = OR1K_LWZ(12, 16) | 4; /* .got+4 */
|
||||
- plt2 = OR1K_NOP;
|
||||
+ plt[0] = OR1K_LWZ(15, 16) | 8; /* .got+8 */
|
||||
+ plt[1] = OR1K_LWZ(12, 16) | 4; /* .got+4 */
|
||||
+ plt[2] = OR1K_NOP;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
|
||||
unsigned lo = got_addr & 0xffff;
|
||||
- plt0 = OR1K_MOVHI(12) | ha;
|
||||
- plt1 = OR1K_LWZ(15,12) | (lo + 8);
|
||||
- plt2 = OR1K_LWZ(12,12) | (lo + 4);
|
||||
+ plt[0] = OR1K_MOVHI(12) | ha;
|
||||
+ plt[1] = OR1K_LWZ(15,12) | (lo + 8);
|
||||
+ plt[2] = OR1K_LWZ(12,12) | (lo + 4);
|
||||
}
|
||||
|
||||
- or1k_write_plt_entry (output_bfd, splt->contents,
|
||||
- plt0, plt1, plt2, OR1K_JR(15));
|
||||
+ or1k_write_plt_entry (output_bfd, splt->contents, OR1K_JR(15),
|
||||
+ plt, plt_insn_count);
|
||||
|
||||
elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
|
||||
}
|
||||
@@ -2340,7 +2371,8 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
|
||||
if (h->plt.offset != (bfd_vma) -1)
|
||||
{
|
||||
- unsigned int plt0, plt1, plt2;
|
||||
+ unsigned int plt[PLT_MAX_INSN_COUNT];
|
||||
+ size_t plt_insn_count = 3;
|
||||
asection *splt;
|
||||
asection *sgot;
|
||||
asection *srela;
|
||||
@@ -2352,6 +2384,7 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
bfd_vma got_offset;
|
||||
bfd_vma got_addr;
|
||||
Elf_Internal_Rela rela;
|
||||
+ bfd_boolean large_plt_entry;
|
||||
|
||||
/* This symbol has an entry in the procedure linkage table. Set
|
||||
it up. */
|
||||
@@ -2369,10 +2402,13 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
corresponds to this symbol. This is the index of this symbol
|
||||
in all the symbols for which we are making plt entries. The
|
||||
first entry in the procedure linkage table is reserved. */
|
||||
- plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
|
||||
+ plt_index = ((struct elf_or1k_link_hash_entry *) h)->plt_index;
|
||||
plt_addr = plt_base_addr + h->plt.offset;
|
||||
plt_reloc = plt_index * sizeof (Elf32_External_Rela);
|
||||
|
||||
+ large_plt_entry = (elf_or1k_plt_entry_size (plt_index)
|
||||
+ == PLT_ENTRY_SIZE_LARGE);
|
||||
+
|
||||
/* Get the offset into the .got table of the entry that
|
||||
corresponds to this function. Each .got entry is 4 bytes.
|
||||
The first three are reserved. */
|
||||
@@ -2384,27 +2420,57 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
{
|
||||
unsigned pa = ((got_addr >> 13) - (plt_addr >> 13)) & 0x1fffff;
|
||||
unsigned po = (got_addr & 0x1fff);
|
||||
- plt0 = OR1K_ADRP(12) | pa;
|
||||
- plt1 = OR1K_LWZ(12,12) | po;
|
||||
- plt2 = OR1K_ORI0(11) | plt_reloc;
|
||||
+ plt[0] = OR1K_ADRP(12) | pa;
|
||||
+ plt[1] = OR1K_LWZ(12,12) | po;
|
||||
+ plt[2] = OR1K_ORI0(11) | plt_reloc;
|
||||
}
|
||||
else if (bfd_link_pic (info))
|
||||
{
|
||||
- plt0 = OR1K_LWZ(12,16) | got_offset;
|
||||
- plt1 = OR1K_ORI0(11) | plt_reloc;
|
||||
- plt2 = OR1K_NOP;
|
||||
+ if (large_plt_entry)
|
||||
+ {
|
||||
+ unsigned gotha = ((got_offset + 0x8000) >> 16) & 0xffff;
|
||||
+ unsigned got = got_offset & 0xffff;
|
||||
+ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
|
||||
+ unsigned pltrello = plt_reloc & 0xffff;
|
||||
+
|
||||
+ plt[0] = OR1K_MOVHI(12) | gotha;
|
||||
+ plt[1] = OR1K_ADD(12,12,16);
|
||||
+ plt[2] = OR1K_LWZ(12,12) | got;
|
||||
+ plt[3] = OR1K_MOVHI(11) | pltrelhi;
|
||||
+ plt[4] = OR1K_ORI(11,11) | pltrello;
|
||||
+ plt_insn_count = 5;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ plt[0] = OR1K_LWZ(12,16) | got_offset;
|
||||
+ plt[1] = OR1K_ORI0(11) | plt_reloc;
|
||||
+ plt[2] = OR1K_NOP;
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
|
||||
unsigned lo = got_addr & 0xffff;
|
||||
- plt0 = OR1K_MOVHI(12) | ha;
|
||||
- plt1 = OR1K_LWZ(12,12) | lo;
|
||||
- plt2 = OR1K_ORI0(11) | plt_reloc;
|
||||
+ plt[0] = OR1K_MOVHI(12) | ha;
|
||||
+ plt[1] = OR1K_LWZ(12,12) | lo;
|
||||
+ plt[2] = OR1K_ORI0(11) | plt_reloc;
|
||||
+ }
|
||||
+
|
||||
+ /* For large code model we fixup the non-PIC PLT relocation instructions
|
||||
+ here. */
|
||||
+ if (large_plt_entry && !bfd_link_pic (info))
|
||||
+ {
|
||||
+ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
|
||||
+ unsigned pltrello = plt_reloc & 0xffff;
|
||||
+
|
||||
+ plt[2] = OR1K_MOVHI(11) | pltrelhi;
|
||||
+ plt[3] = OR1K_ORI(11,11) | pltrello;
|
||||
+ plt[4] = OR1K_NOP;
|
||||
+ plt_insn_count = 5;
|
||||
}
|
||||
|
||||
or1k_write_plt_entry (output_bfd, splt->contents + h->plt.offset,
|
||||
- plt0, plt1, plt2, OR1K_JR(12));
|
||||
+ OR1K_JR(12), plt, plt_insn_count);
|
||||
|
||||
/* Fill in the entry in the global offset table. We initialize it to
|
||||
point to the top of the plt. This is done to lazy lookup the actual
|
||||
@@ -2699,11 +2765,16 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
|
||||
{
|
||||
asection *s = htab->root.splt;
|
||||
+ bfd_vma plt_index;
|
||||
+
|
||||
+ /* Track the index of our plt entry for use in calculating size. */
|
||||
+ plt_index = htab->plt_count++;
|
||||
+ ((struct elf_or1k_link_hash_entry *) h)->plt_index = plt_index;
|
||||
|
||||
/* If this is the first .plt entry, make room for the special
|
||||
first entry. */
|
||||
if (s->size == 0)
|
||||
- s->size = PLT_ENTRY_SIZE;
|
||||
+ s->size = elf_or1k_plt_entry_size (plt_index);
|
||||
|
||||
h->plt.offset = s->size;
|
||||
|
||||
@@ -2720,7 +2791,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
}
|
||||
|
||||
/* Make room for this entry. */
|
||||
- s->size += PLT_ENTRY_SIZE;
|
||||
+ s->size += elf_or1k_plt_entry_size (plt_index);
|
||||
|
||||
/* We also need to make an entry in the .got.plt section, which
|
||||
will be placed in the .got section by the linker script. */
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha1.dd b/ld/testsuite/ld-or1k/gotha1.dd
|
||||
new file mode 100644
|
||||
index 00000000000..0ad1f8f5399
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha1.dd
|
||||
@@ -0,0 +1,34 @@
|
||||
+
|
||||
+.*\.x: file format elf32-or1k
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.plt:
|
||||
+
|
||||
+[0-9a-f]+ <\.plt>:
|
||||
+ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
|
||||
+ +[0-9a-f]+: 85 ec [0-9a-f]+ [0-9a-f]+ l\.lwz r15,[0-9]+\(r12\)
|
||||
+ +[0-9a-f]+: 44 00 78 00 l\.jr r15
|
||||
+ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
|
||||
+ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
|
||||
+ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
|
||||
+ +[0-9a-f]+: 44 00 60 00 l\.jr r12
|
||||
+ +[0-9a-f]+: a9 60 00 00 l\.ori r11,r0,0x0
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+[0-9a-f]+ <_start>:
|
||||
+ +[0-9a-f]+: 9c 21 ff fc l\.addi r1,r1,-4
|
||||
+ +[0-9a-f]+: d4 01 48 00 l\.sw 0\(r1\),r9
|
||||
+ +[0-9a-f]+: 04 00 00 02 l\.jal [0-9a-f]+ <_start\+0x10>
|
||||
+ +[0-9a-f]+: 1a 60 00 00 l\.movhi r19,0x0
|
||||
+ +[0-9a-f]+: aa 73 [0-9a-f]+ [0-9a-f]+ l\.ori r19,r19,0x[0-9a-f]+
|
||||
+ +[0-9a-f]+: e2 73 48 00 l\.add r19,r19,r9
|
||||
+ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
|
||||
+ +[0-9a-f]+: e2 31 98 00 l\.add r17,r17,r19
|
||||
+ +[0-9a-f]+: 86 31 00 10 l\.lwz r17,16\(r17\)
|
||||
+ +[0-9a-f]+: 84 71 00 00 l\.lwz r3,0\(r17\)
|
||||
+ +[0-9a-f]+: 07 ff ff f2 l\.jal [0-9a-f]+ <\.plt\+0x10>
|
||||
+ +[0-9a-f]+: 15 00 00 00 l\.nop 0x0
|
||||
+ +[0-9a-f]+: 85 21 00 00 l\.lwz r9,0\(r1\)
|
||||
+ +[0-9a-f]+: 44 00 48 00 l\.jr r9
|
||||
+ +[0-9a-f]+: 9c 21 00 04 l\.addi r1,r1,4
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha1.s b/ld/testsuite/ld-or1k/gotha1.s
|
||||
new file mode 100644
|
||||
index 00000000000..42b16db425c
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha1.s
|
||||
@@ -0,0 +1,24 @@
|
||||
+ .data
|
||||
+ .p2align 16
|
||||
+
|
||||
+ .text
|
||||
+ .globl _start
|
||||
+_start:
|
||||
+ l.addi r1, r1, -4
|
||||
+ l.sw 0(r1), r9
|
||||
+
|
||||
+ l.jal 8
|
||||
+ l.movhi r19, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
|
||||
+ l.ori r19, r19, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
|
||||
+ l.add r19, r19, r9
|
||||
+
|
||||
+ l.movhi r17, gotha(x)
|
||||
+ l.add r17, r17, r19
|
||||
+ l.lwz r17, got(x)(r17)
|
||||
+ l.lwz r3, 0(r17)
|
||||
+
|
||||
+ l.jal plt(func)
|
||||
+ l.nop
|
||||
+ l.lwz r9, 0(r1)
|
||||
+ l.jr r9
|
||||
+ l.addi r1, r1, 4
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha2.dd b/ld/testsuite/ld-or1k/gotha2.dd
|
||||
new file mode 100644
|
||||
index 00000000000..fe09da5466b
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha2.dd
|
||||
@@ -0,0 +1,21 @@
|
||||
+
|
||||
+.*\.x: file format elf32-or1k
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+[0-9a-f]+ <test>:
|
||||
+ +[0-9a-f]+: 9c 21 ff f8 l\.addi r1,r1,-8
|
||||
+ +[0-9a-f]+: d4 01 80 00 l\.sw 0\(r1\),r16
|
||||
+ +[0-9a-f]+: d4 01 48 04 l\.sw 4\(r1\),r9
|
||||
+ +[0-9a-f]+: 04 00 [0-9a-f]+ [0-9a-f]+ l\.jal [0-9a-f]+ <test\+0x14>
|
||||
+ +[0-9a-f]+: 1a 00 00 00 l\.movhi r16,0x0
|
||||
+ +[0-9a-f]+: aa 10 [0-9a-f]+ [0-9a-f]+ l\.ori r16,r16,0x[0-9a-f]+
|
||||
+ +[0-9a-f]+: e2 10 48 00 l\.add r16,r16,r9
|
||||
+ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
|
||||
+ +[0-9a-f]+: e2 31 80 00 l\.add r17,r17,r16
|
||||
+ +[0-9a-f]+: 86 31 00 0c l\.lwz r17,12\(r17\)
|
||||
+ +[0-9a-f]+: 85 21 00 04 l\.lwz r9,4\(r1\)
|
||||
+ +[0-9a-f]+: 86 01 00 00 l\.lwz r16,0\(r1\)
|
||||
+ +[0-9a-f]+: 44 00 48 00 l\.jr r9
|
||||
+ +[0-9a-f]+: 9c 21 00 08 l\.addi r1,r1,8
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha2.s b/ld/testsuite/ld-or1k/gotha2.s
|
||||
new file mode 100644
|
||||
index 00000000000..164b282f2dd
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha2.s
|
||||
@@ -0,0 +1,22 @@
|
||||
+ .section .text
|
||||
+ .align 4
|
||||
+ .global test
|
||||
+ .type test, @function
|
||||
+test:
|
||||
+ l.addi r1, r1, -8
|
||||
+ l.sw 0(r1), r16
|
||||
+ l.sw 4(r1), r9
|
||||
+
|
||||
+ l.jal 8
|
||||
+ l.movhi r16, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
|
||||
+ l.ori r16, r16, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
|
||||
+ l.add r16, r16, r9
|
||||
+
|
||||
+ l.movhi r17, gotha(i)
|
||||
+ l.add r17, r17, r16
|
||||
+ l.lwz r17, got(i)(r17)
|
||||
+
|
||||
+ l.lwz r9, 4(r1)
|
||||
+ l.lwz r16, 0(r1)
|
||||
+ l.jr r9
|
||||
+ l.addi r1, r1, 8
|
||||
diff --git a/ld/testsuite/ld-or1k/or1k.exp b/ld/testsuite/ld-or1k/or1k.exp
|
||||
index 7592e8307c1..8e19ec6c31a 100644
|
||||
--- a/ld/testsuite/ld-or1k/or1k.exp
|
||||
+++ b/ld/testsuite/ld-or1k/or1k.exp
|
||||
@@ -53,6 +53,14 @@ set or1kplttests {
|
||||
"" {plt1.s}
|
||||
{{objdump -dr plt1.x.dd}}
|
||||
"plt1.x"}
|
||||
+ {"gotha exec plt" "tmpdir/libpltlib.so" ""
|
||||
+ "" {gotha1.s}
|
||||
+ {{objdump -dr gotha1.dd}}
|
||||
+ "gotha1.x"}
|
||||
+ {"gotha -fpic -shared" "-fpic -shared" ""
|
||||
+ "" {gotha2.s}
|
||||
+ {{objdump -dr gotha2.dd}}
|
||||
+ "gotha2.x"}
|
||||
}
|
||||
|
||||
# Not implemented yet
|
||||
diff --git a/ld/testsuite/ld-or1k/pltlib.s b/ld/testsuite/ld-or1k/pltlib.s
|
||||
index baf76ca1af7..8b4d7ba48fd 100644
|
||||
--- a/ld/testsuite/ld-or1k/pltlib.s
|
||||
+++ b/ld/testsuite/ld-or1k/pltlib.s
|
||||
@@ -1,5 +1,6 @@
|
||||
.section .data
|
||||
.globl x, y
|
||||
+ .size x, 4
|
||||
x: .long 33
|
||||
y: .long 44
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
From 1659226a96b1daecfd08c057d0d5c39309d207ee Mon Sep 17 00:00:00 2001
|
||||
From: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
Date: Mon, 22 Mar 2021 13:30:07 +0100
|
||||
Subject: [PATCH] bfd/elf32-or1k: fix ld assert
|
||||
|
||||
Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=27624
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 65938e5137..41908f8938 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -2566,11 +2566,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if (h->type == STT_FUNC
|
||||
|| h->needs_plt)
|
||||
{
|
||||
- if (! bfd_link_pic (info)
|
||||
- && !h->def_dynamic
|
||||
- && !h->ref_dynamic
|
||||
- && h->root.type != bfd_link_hash_undefweak
|
||||
- && h->root.type != bfd_link_hash_undefined)
|
||||
+ if (h->plt.refcount <= 0
|
||||
+ || (SYMBOL_CALLS_LOCAL (info, h)
|
||||
+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|
||||
+ && h->root.type == bfd_link_hash_undefweak)))
|
||||
{
|
||||
/* This case can occur if we saw a PLT reloc in an input
|
||||
file, but the symbol was never referred to by a dynamic
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
From baf313f84b106a5a29f01796afd857e69abf8b08 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:14 +0900
|
||||
Subject: [PATCH] or1k: Fix issue with plt link failure for local calls
|
||||
|
||||
When building protobuf we were seeing the assert failure:
|
||||
|
||||
/home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
|
||||
BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
|
||||
/home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
|
||||
BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
|
||||
/home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
|
||||
BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
|
||||
collect2: error: ld returned 1 exit status
|
||||
|
||||
This failure happens while writing out PLT entries, there is a check
|
||||
"BFD_ASSERT (h->dynindx != -1)" to confirm all plt entries have dynamic
|
||||
symbol attributes. This was failing for symbols that were
|
||||
"forced_local" in previous linking code.
|
||||
|
||||
The fix adds logic to or1k_elf_adjust_dynamic_symbol to identify
|
||||
"forced_local" symbols and exclude them from the the PLT.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 27624
|
||||
* elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Change
|
||||
condition used to cleanup plt entries to cleanup forced local
|
||||
entries.
|
||||
|
||||
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 7c02d004cc7..bbfa2bfe614 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -2568,11 +2568,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if (h->type == STT_FUNC
|
||||
|| h->needs_plt)
|
||||
{
|
||||
- if (! bfd_link_pic (info)
|
||||
- && !h->def_dynamic
|
||||
- && !h->ref_dynamic
|
||||
- && h->root.type != bfd_link_hash_undefweak
|
||||
- && h->root.type != bfd_link_hash_undefined)
|
||||
+ if (h->plt.refcount <= 0
|
||||
+ || (SYMBOL_CALLS_LOCAL (info, h)
|
||||
+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|
||||
+ && h->root.type == bfd_link_hash_undefweak)))
|
||||
{
|
||||
/* This case can occur if we saw a PLT reloc in an input
|
||||
file, but the symbol was never referred to by a dynamic
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+256
@@ -0,0 +1,256 @@
|
||||
From c67656e248d6dadaa2729975a17c8dd03afe48d0 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:15 +0900
|
||||
Subject: [PATCH] or1k: Implement relocation R_OR1K_GOT_AHI16 for gotha()
|
||||
|
||||
The gotha() relocation mnemonic will be outputted by OpenRISC GCC when
|
||||
using the -mcmodel=large option. This relocation is used along with
|
||||
got() to generate 32-bit GOT offsets. This increases the previous GOT
|
||||
offset limit from the previous 16-bit (64K) limit.
|
||||
|
||||
This is needed on large binaries where the GOT grows larger than 64k.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* bfd-in2.h: Add BFD_RELOC_OR1K_GOT_AHI16 relocation.
|
||||
* elf32-or1k.c (or1k_elf_howto_table, or1k_reloc_map): Likewise.
|
||||
(or1k_final_link_relocate, or1k_elf_relocate_section,
|
||||
or1k_elf_check_relocs): Likewise.
|
||||
* libbfd.h (bfd_reloc_code_real_names): Likewise.
|
||||
* reloc.c: Likewise.
|
||||
|
||||
cpu/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* or1k.opc (or1k_imm16_relocs, parse_reloc): Define parse logic
|
||||
for gotha() relocation.
|
||||
|
||||
include/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* elf/or1k.h (elf_or1k_reloc_type): Define R_OR1K_GOT_AHI16 number.
|
||||
|
||||
opcodes/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* or1k-asm.c: Regenerate.
|
||||
|
||||
gas/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* testsuite/gas/or1k/reloc-1.s: Add test for new relocation.
|
||||
* testsuite/gas/or1k/reloc-1.d: Add test result for new
|
||||
relocation.
|
||||
|
||||
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
|
||||
fixup reloc, add tests
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/bfd-in2.h | 1 +
|
||||
bfd/elf32-or1k.c | 21 ++++++++++++++++++++-
|
||||
bfd/libbfd.h | 1 +
|
||||
bfd/reloc.c | 2 ++
|
||||
cpu/or1k.opc | 7 ++++++-
|
||||
gas/testsuite/gas/or1k/reloc-1.d | 4 +++-
|
||||
gas/testsuite/gas/or1k/reloc-1.s | 4 ++++
|
||||
include/elf/or1k.h | 1 +
|
||||
opcodes/or1k-asm.c | 7 ++++++-
|
||||
9 files changed, 44 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
|
||||
index df6f9f45673..ab861395e93 100644
|
||||
--- a/bfd/bfd-in2.h
|
||||
+++ b/bfd/bfd-in2.h
|
||||
@@ -5041,6 +5041,7 @@ then it may be truncated to 8 bits. */
|
||||
BFD_RELOC_OR1K_TLS_TPOFF,
|
||||
BFD_RELOC_OR1K_TLS_DTPOFF,
|
||||
BFD_RELOC_OR1K_TLS_DTPMOD,
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16,
|
||||
|
||||
/* H8 elf Relocations. */
|
||||
BFD_RELOC_H8_DIR16A8,
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index bbfa2bfe614..8e395827123 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -808,6 +808,20 @@ static reloc_howto_type or1k_elf_howto_table[] =
|
||||
0, /* Source Mask. */
|
||||
0x03ffffff, /* Dest Mask. */
|
||||
TRUE), /* PC relative offset? */
|
||||
+
|
||||
+ HOWTO (R_OR1K_GOT_AHI16, /* type */
|
||||
+ 16, /* rightshift */
|
||||
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
+ 16, /* bitsize */
|
||||
+ FALSE, /* pc_relative */
|
||||
+ 0, /* bitpos */
|
||||
+ complain_overflow_signed, /* complain_on_overflow */
|
||||
+ bfd_elf_generic_reloc, /* special_function */
|
||||
+ "R_OR1K_GOT_AHI16", /* name */
|
||||
+ FALSE, /* partial_inplace */
|
||||
+ 0, /* src_mask */
|
||||
+ 0xffff, /* dst_mask */
|
||||
+ FALSE), /* pcrel_offset */
|
||||
};
|
||||
|
||||
/* Map BFD reloc types to Or1k ELF reloc types. */
|
||||
@@ -871,6 +885,7 @@ static const struct or1k_reloc_map or1k_reloc_map[] =
|
||||
{ BFD_RELOC_OR1K_TLS_IE_LO13, R_OR1K_TLS_IE_LO13 },
|
||||
{ BFD_RELOC_OR1K_SLO13, R_OR1K_SLO13 },
|
||||
{ BFD_RELOC_OR1K_PLTA26, R_OR1K_PLTA26 },
|
||||
+ { BFD_RELOC_OR1K_GOT_AHI16, R_OR1K_GOT_AHI16 },
|
||||
};
|
||||
|
||||
/* tls_type is a mask used to track how each symbol is accessed,
|
||||
@@ -1113,6 +1128,7 @@ or1k_final_link_relocate (reloc_howto_type *howto, bfd *input_bfd,
|
||||
switch (howto->type)
|
||||
{
|
||||
case R_OR1K_AHI16:
|
||||
+ case R_OR1K_GOT_AHI16:
|
||||
case R_OR1K_GOTOFF_AHI16:
|
||||
case R_OR1K_TLS_IE_AHI16:
|
||||
case R_OR1K_TLS_LE_AHI16:
|
||||
@@ -1375,6 +1391,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
}
|
||||
break;
|
||||
|
||||
+ case R_OR1K_GOT_AHI16:
|
||||
case R_OR1K_GOT16:
|
||||
case R_OR1K_GOT_PG21:
|
||||
case R_OR1K_GOT_LO13:
|
||||
@@ -1466,7 +1483,8 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
/* The GOT_PG21 and GOT_LO13 relocs are pc-relative,
|
||||
while the GOT16 reloc is GOT relative. */
|
||||
relocation = got_base + off;
|
||||
- if (r_type == R_OR1K_GOT16)
|
||||
+ if (r_type == R_OR1K_GOT16
|
||||
+ || r_type == R_OR1K_GOT_AHI16)
|
||||
relocation -= got_sym_value;
|
||||
|
||||
/* Addend should be zero. */
|
||||
@@ -1992,6 +2010,7 @@ or1k_elf_check_relocs (bfd *abfd,
|
||||
}
|
||||
break;
|
||||
|
||||
+ case R_OR1K_GOT_AHI16:
|
||||
case R_OR1K_GOT16:
|
||||
case R_OR1K_GOT_PG21:
|
||||
case R_OR1K_GOT_LO13:
|
||||
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
|
||||
index b97534fc9fe..795c9b9d27f 100644
|
||||
--- a/bfd/libbfd.h
|
||||
+++ b/bfd/libbfd.h
|
||||
@@ -2755,6 +2755,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
|
||||
"BFD_RELOC_OR1K_TLS_TPOFF",
|
||||
"BFD_RELOC_OR1K_TLS_DTPOFF",
|
||||
"BFD_RELOC_OR1K_TLS_DTPMOD",
|
||||
+ "BFD_RELOC_OR1K_GOT_AHI16",
|
||||
"BFD_RELOC_H8_DIR16A8",
|
||||
"BFD_RELOC_H8_DIR16R8",
|
||||
"BFD_RELOC_H8_DIR24A8",
|
||||
diff --git a/bfd/reloc.c b/bfd/reloc.c
|
||||
index 9aba84ca81e..1e021febef2 100644
|
||||
--- a/bfd/reloc.c
|
||||
+++ b/bfd/reloc.c
|
||||
@@ -6175,6 +6175,8 @@ ENUMX
|
||||
BFD_RELOC_OR1K_GOTPC_HI16
|
||||
ENUMX
|
||||
BFD_RELOC_OR1K_GOTPC_LO16
|
||||
+ENUMX
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16
|
||||
ENUMX
|
||||
BFD_RELOC_OR1K_GOT16
|
||||
ENUMX
|
||||
diff --git a/cpu/or1k.opc b/cpu/or1k.opc
|
||||
index f0adcbb00a5..5d20a1f33a7 100644
|
||||
--- a/cpu/or1k.opc
|
||||
+++ b/cpu/or1k.opc
|
||||
@@ -193,7 +193,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
|
||||
BFD_RELOC_OR1K_GOT_LO13,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
- BFD_RELOC_UNUSED },
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16 },
|
||||
{ BFD_RELOC_OR1K_GOTPC_LO16,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
@@ -296,6 +296,11 @@ parse_reloc (const char **strp)
|
||||
str += 5;
|
||||
cls = RCLASS_TPOFF;
|
||||
}
|
||||
+ else if (strncasecmp (str, "got", 3) == 0)
|
||||
+ {
|
||||
+ str += 3;
|
||||
+ cls = RCLASS_GOT;
|
||||
+ }
|
||||
|
||||
if (strncasecmp (str, "hi(", 3) == 0)
|
||||
{
|
||||
diff --git a/gas/testsuite/gas/or1k/reloc-1.d b/gas/testsuite/gas/or1k/reloc-1.d
|
||||
index d1bcf5608bb..3a001c4ed99 100644
|
||||
--- a/gas/testsuite/gas/or1k/reloc-1.d
|
||||
+++ b/gas/testsuite/gas/or1k/reloc-1.d
|
||||
@@ -68,5 +68,7 @@ OFFSET TYPE VALUE
|
||||
000000ec R_OR1K_LO13 x
|
||||
000000f0 R_OR1K_GOT_LO13 x
|
||||
000000f4 R_OR1K_SLO13 x
|
||||
-
|
||||
+000000f8 R_OR1K_GOT_AHI16 x
|
||||
+000000fc R_OR1K_GOT_AHI16 x
|
||||
+00000100 R_OR1K_GOT_AHI16 x
|
||||
|
||||
diff --git a/gas/testsuite/gas/or1k/reloc-1.s b/gas/testsuite/gas/or1k/reloc-1.s
|
||||
index e76abef6532..562609aa869 100644
|
||||
--- a/gas/testsuite/gas/or1k/reloc-1.s
|
||||
+++ b/gas/testsuite/gas/or1k/reloc-1.s
|
||||
@@ -74,3 +74,7 @@
|
||||
l.lbz r5,po(x)(r3)
|
||||
l.lbz r5,gotpo(x)(r3)
|
||||
l.sb po(x)(r3),r6
|
||||
+
|
||||
+ l.movhi r4,gotha(x)
|
||||
+ l.ori r3,r4,gotha(x)
|
||||
+ l.addi r3,r4,gotha(x)
|
||||
diff --git a/include/elf/or1k.h b/include/elf/or1k.h
|
||||
index a215ef5c17e..dff37d875f2 100644
|
||||
--- a/include/elf/or1k.h
|
||||
+++ b/include/elf/or1k.h
|
||||
@@ -77,6 +77,7 @@ START_RELOC_NUMBERS (elf_or1k_reloc_type)
|
||||
RELOC_NUMBER (R_OR1K_TLS_IE_LO13, 51)
|
||||
RELOC_NUMBER (R_OR1K_SLO13, 52)
|
||||
RELOC_NUMBER (R_OR1K_PLTA26, 53)
|
||||
+ RELOC_NUMBER (R_OR1K_GOT_AHI16, 54)
|
||||
END_RELOC_NUMBERS (R_OR1K_max)
|
||||
|
||||
#define EF_OR1K_NODELAY (1UL << 0)
|
||||
diff --git a/opcodes/or1k-asm.c b/opcodes/or1k-asm.c
|
||||
index 5f3c6c74b12..e0c49b3b8cd 100644
|
||||
--- a/opcodes/or1k-asm.c
|
||||
+++ b/opcodes/or1k-asm.c
|
||||
@@ -177,7 +177,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
|
||||
BFD_RELOC_OR1K_GOT_LO13,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
- BFD_RELOC_UNUSED },
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16 },
|
||||
{ BFD_RELOC_OR1K_GOTPC_LO16,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
@@ -280,6 +280,11 @@ parse_reloc (const char **strp)
|
||||
str += 5;
|
||||
cls = RCLASS_TPOFF;
|
||||
}
|
||||
+ else if (strncasecmp (str, "got", 3) == 0)
|
||||
+ {
|
||||
+ str += 3;
|
||||
+ cls = RCLASS_GOT;
|
||||
+ }
|
||||
|
||||
if (strncasecmp (str, "hi(", 3) == 0)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
From 097b83a1c9c694a14e6081cee034bf24f16875c1 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:16 +0900
|
||||
Subject: [PATCH] or1k: Avoid R_OR1K_GOT16 overflow failures in presence of
|
||||
R_OR1K_GOT_AHI16
|
||||
|
||||
Now that we support R_OR1K_GOT_AHI16 we can relax the R_OR1K_GOT16
|
||||
overflow validation check if the section has R_OR1K_GOT_AHI16.
|
||||
|
||||
We cannot simple disable R_OR1K_GOT16 overflow validation as there will
|
||||
still be binaries that will have only R_OR1K_GOT16. The
|
||||
R_OR1K_GOT_AHI16 relocation will only be added by GCC when building with
|
||||
the option -mcmodel=large.
|
||||
|
||||
This assumes that R_OR1K_GOT_AHI16 will come before R_OR1K_GOT16, which
|
||||
is the code pattern that will be emitted by GCC.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* elf32-or1k.c (or1k_elf_relocate_section): Relax R_OR1K_GOT16
|
||||
overflow check if we have R_OR1K_GOT_AHI16 followed by
|
||||
R_OR1K_GOT16.
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 8e395827123..9f315bfda99 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -1280,6 +1280,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
asection *sgot, *splt;
|
||||
bfd_vma plt_base, got_base, got_sym_value;
|
||||
bfd_boolean ret_val = TRUE;
|
||||
+ bfd_boolean saw_gotha = FALSE;
|
||||
|
||||
if (htab == NULL)
|
||||
return FALSE;
|
||||
@@ -1487,6 +1488,16 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
|| r_type == R_OR1K_GOT_AHI16)
|
||||
relocation -= got_sym_value;
|
||||
|
||||
+ if (r_type == R_OR1K_GOT_AHI16)
|
||||
+ saw_gotha = TRUE;
|
||||
+
|
||||
+ /* If we have a R_OR1K_GOT16 followed by a R_OR1K_GOT_AHI16
|
||||
+ relocation we assume the code is doing the right thing to avoid
|
||||
+ overflows. Here we mask the lower 16-bit of the relocation to
|
||||
+ avoid overflow validation failures. */
|
||||
+ if (r_type == R_OR1K_GOT16 && saw_gotha)
|
||||
+ relocation &= 0xffff;
|
||||
+
|
||||
/* Addend should be zero. */
|
||||
if (rel->r_addend != 0)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+500
@@ -0,0 +1,500 @@
|
||||
From c87692eb894b4b86eced7b7ba205f9bf27c2c213 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:17 +0900
|
||||
Subject: [PATCH] or1k: Support large plt_relocs when generating plt
|
||||
entries
|
||||
|
||||
The current PLT generation code will generate invalid code when the PLT
|
||||
relocation offset exceeds 64k. This fixes the issue by detecting large
|
||||
plt_reloc offsets and generare code sequences to create larger plt
|
||||
relocations.
|
||||
|
||||
The "large" plt code needs 2 extra instructions to create 32-bit offsets.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 27746
|
||||
* elf32-or1k.c (PLT_ENTRY_SIZE_LARGE, PLT_MAX_INSN_COUNT,
|
||||
OR1K_ADD, OR1K_ORI): New macros to help with plt creation.
|
||||
(elf_or1k_link_hash_table): New field plt_count.
|
||||
(elf_or1k_link_hash_entry): New field plt_index.
|
||||
(elf_or1k_plt_entry_size): New function.
|
||||
(or1k_write_plt_entry): Update to support variable size PLTs.
|
||||
(or1k_elf_finish_dynamic_sections): Use new or1k_write_plt_entry
|
||||
API.
|
||||
(or1k_elf_finish_dynamic_symbol): Update to write large PLTs
|
||||
when needed.
|
||||
(allocate_dynrelocs): Use elf_or1k_plt_entry_size to account for
|
||||
PLT size.
|
||||
|
||||
ld/ChangeLog:
|
||||
|
||||
PR 27746
|
||||
testsuite/ld-or1k/or1k.exp (or1kplttests): Add tests for linking
|
||||
along with gotha() relocations.
|
||||
testsuite/ld-or1k/gotha1.dd: New file.
|
||||
testsuite/ld-or1k/gotha1.s: New file.
|
||||
testsuite/ld-or1k/gotha2.dd: New file.
|
||||
testsuite/ld-or1k/gotha2.s: New file
|
||||
testsuite/ld-or1k/pltlib.s (x): Define size to avoid link
|
||||
failure.
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 149 ++++++++++++++++++++++++---------
|
||||
ld/testsuite/ld-or1k/gotha1.dd | 34 ++++++++
|
||||
ld/testsuite/ld-or1k/gotha1.s | 24 ++++++
|
||||
ld/testsuite/ld-or1k/gotha2.dd | 21 +++++
|
||||
ld/testsuite/ld-or1k/gotha2.s | 22 +++++
|
||||
ld/testsuite/ld-or1k/or1k.exp | 8 ++
|
||||
ld/testsuite/ld-or1k/pltlib.s | 1 +
|
||||
7 files changed, 220 insertions(+), 39 deletions(-)
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha1.dd
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha1.s
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha2.dd
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha2.s
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 9f315bfda99..7a14eaa3a46 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -30,10 +30,14 @@
|
||||
#define N_ONES(X) (((bfd_vma)2 << (X)) - 1)
|
||||
|
||||
#define PLT_ENTRY_SIZE 16
|
||||
+#define PLT_ENTRY_SIZE_LARGE (6*4)
|
||||
+#define PLT_MAX_INSN_COUNT 6
|
||||
|
||||
#define OR1K_MOVHI(D) (0x18000000 | (D << 21))
|
||||
#define OR1K_ADRP(D) (0x08000000 | (D << 21))
|
||||
#define OR1K_LWZ(D,A) (0x84000000 | (D << 21) | (A << 16))
|
||||
+#define OR1K_ADD(D,A,B) (0xE0000000 | (D << 21) | (A << 16) | (B << 11))
|
||||
+#define OR1K_ORI(D,A) (0xA8000000 | (D << 21) | (A << 16))
|
||||
#define OR1K_ORI0(D) (0xA8000000 | (D << 21))
|
||||
#define OR1K_JR(B) (0x44000000 | (B << 11))
|
||||
#define OR1K_NOP 0x15000000
|
||||
@@ -907,6 +911,8 @@ struct elf_or1k_link_hash_entry
|
||||
{
|
||||
struct elf_link_hash_entry root;
|
||||
|
||||
+ /* For calculating PLT size. */
|
||||
+ bfd_vma plt_index;
|
||||
/* Track type of TLS access. */
|
||||
unsigned char tls_type;
|
||||
};
|
||||
@@ -934,9 +940,20 @@ struct elf_or1k_link_hash_table
|
||||
/* Small local sym to section mapping cache. */
|
||||
struct sym_cache sym_sec;
|
||||
|
||||
+ bfd_vma plt_count;
|
||||
bfd_boolean saw_plta;
|
||||
};
|
||||
|
||||
+static size_t
|
||||
+elf_or1k_plt_entry_size (bfd_vma plt_index)
|
||||
+{
|
||||
+ bfd_vma plt_reloc;
|
||||
+
|
||||
+ plt_reloc = plt_index * sizeof (Elf32_External_Rela);
|
||||
+
|
||||
+ return (plt_reloc > 0xffff) ? PLT_ENTRY_SIZE_LARGE : PLT_ENTRY_SIZE;
|
||||
+}
|
||||
+
|
||||
/* Get the ELF linker hash table from a link_info structure. */
|
||||
#define or1k_elf_hash_table(p) \
|
||||
(elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
|
||||
@@ -2224,33 +2241,46 @@ or1k_elf_check_relocs (bfd *abfd,
|
||||
}
|
||||
|
||||
static void
|
||||
-or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insn1,
|
||||
- unsigned insn2, unsigned insn3, unsigned insnj)
|
||||
+or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
|
||||
+ unsigned insns[], size_t insn_count)
|
||||
{
|
||||
unsigned nodelay = elf_elfheader (output_bfd)->e_flags & EF_OR1K_NODELAY;
|
||||
- unsigned insn4;
|
||||
+ unsigned output_insns[PLT_MAX_INSN_COUNT];
|
||||
+
|
||||
+ /* Copy instructions into the output buffer. */
|
||||
+ for (size_t i = 0; i < insn_count; i++)
|
||||
+ output_insns[i] = insns[i];
|
||||
|
||||
/* Honor the no-delay-slot setting. */
|
||||
- if (insn3 == OR1K_NOP)
|
||||
+ if (insns[insn_count-1] == OR1K_NOP)
|
||||
{
|
||||
- insn4 = insn3;
|
||||
+ unsigned slot1, slot2;
|
||||
+
|
||||
if (nodelay)
|
||||
- insn3 = insnj;
|
||||
+ slot1 = insns[insn_count-2], slot2 = insnj;
|
||||
else
|
||||
- insn3 = insn2, insn2 = insnj;
|
||||
+ slot1 = insnj, slot2 = insns[insn_count-2];
|
||||
+
|
||||
+ output_insns[insn_count-2] = slot1;
|
||||
+ output_insns[insn_count-1] = slot2;
|
||||
+ output_insns[insn_count] = OR1K_NOP;
|
||||
}
|
||||
else
|
||||
{
|
||||
+ unsigned slot1, slot2;
|
||||
+
|
||||
if (nodelay)
|
||||
- insn4 = insnj;
|
||||
+ slot1 = insns[insn_count-1], slot2 = insnj;
|
||||
else
|
||||
- insn4 = insn3, insn3 = insnj;
|
||||
+ slot1 = insnj, slot2 = insns[insn_count-1];
|
||||
+
|
||||
+ output_insns[insn_count-1] = slot1;
|
||||
+ output_insns[insn_count] = slot2;
|
||||
}
|
||||
|
||||
- bfd_put_32 (output_bfd, insn1, contents);
|
||||
- bfd_put_32 (output_bfd, insn2, contents + 4);
|
||||
- bfd_put_32 (output_bfd, insn3, contents + 8);
|
||||
- bfd_put_32 (output_bfd, insn4, contents + 12);
|
||||
+ /* Write out the output buffer. */
|
||||
+ for (size_t i = 0; i < (insn_count+1); i++)
|
||||
+ bfd_put_32 (output_bfd, output_insns[i], contents + (i*4));
|
||||
}
|
||||
|
||||
/* Finish up the dynamic sections. */
|
||||
@@ -2317,7 +2347,8 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
|
||||
splt = htab->root.splt;
|
||||
if (splt && splt->size > 0)
|
||||
{
|
||||
- unsigned plt0, plt1, plt2;
|
||||
+ unsigned plt[PLT_MAX_INSN_COUNT];
|
||||
+ size_t plt_insn_count = 3;
|
||||
bfd_vma got_addr = sgot->output_section->vma + sgot->output_offset;
|
||||
|
||||
/* Note we force 16 byte alignment on the .got, so that
|
||||
@@ -2328,27 +2359,27 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
|
||||
bfd_vma pc = splt->output_section->vma + splt->output_offset;
|
||||
unsigned pa = ((got_addr >> 13) - (pc >> 13)) & 0x1fffff;
|
||||
unsigned po = got_addr & 0x1fff;
|
||||
- plt0 = OR1K_ADRP(12) | pa;
|
||||
- plt1 = OR1K_LWZ(15,12) | (po + 8);
|
||||
- plt2 = OR1K_LWZ(12,12) | (po + 4);
|
||||
+ plt[0] = OR1K_ADRP(12) | pa;
|
||||
+ plt[1] = OR1K_LWZ(15,12) | (po + 8);
|
||||
+ plt[2] = OR1K_LWZ(12,12) | (po + 4);
|
||||
}
|
||||
else if (bfd_link_pic (info))
|
||||
{
|
||||
- plt0 = OR1K_LWZ(15, 16) | 8; /* .got+8 */
|
||||
- plt1 = OR1K_LWZ(12, 16) | 4; /* .got+4 */
|
||||
- plt2 = OR1K_NOP;
|
||||
+ plt[0] = OR1K_LWZ(15, 16) | 8; /* .got+8 */
|
||||
+ plt[1] = OR1K_LWZ(12, 16) | 4; /* .got+4 */
|
||||
+ plt[2] = OR1K_NOP;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
|
||||
unsigned lo = got_addr & 0xffff;
|
||||
- plt0 = OR1K_MOVHI(12) | ha;
|
||||
- plt1 = OR1K_LWZ(15,12) | (lo + 8);
|
||||
- plt2 = OR1K_LWZ(12,12) | (lo + 4);
|
||||
+ plt[0] = OR1K_MOVHI(12) | ha;
|
||||
+ plt[1] = OR1K_LWZ(15,12) | (lo + 8);
|
||||
+ plt[2] = OR1K_LWZ(12,12) | (lo + 4);
|
||||
}
|
||||
|
||||
- or1k_write_plt_entry (output_bfd, splt->contents,
|
||||
- plt0, plt1, plt2, OR1K_JR(15));
|
||||
+ or1k_write_plt_entry (output_bfd, splt->contents, OR1K_JR(15),
|
||||
+ plt, plt_insn_count);
|
||||
|
||||
elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
|
||||
}
|
||||
@@ -2391,7 +2422,8 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
|
||||
if (h->plt.offset != (bfd_vma) -1)
|
||||
{
|
||||
- unsigned int plt0, plt1, plt2;
|
||||
+ unsigned int plt[PLT_MAX_INSN_COUNT];
|
||||
+ size_t plt_insn_count = 3;
|
||||
asection *splt;
|
||||
asection *sgot;
|
||||
asection *srela;
|
||||
@@ -2403,6 +2435,7 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
bfd_vma got_offset;
|
||||
bfd_vma got_addr;
|
||||
Elf_Internal_Rela rela;
|
||||
+ bfd_boolean large_plt_entry;
|
||||
|
||||
/* This symbol has an entry in the procedure linkage table. Set
|
||||
it up. */
|
||||
@@ -2420,10 +2453,13 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
corresponds to this symbol. This is the index of this symbol
|
||||
in all the symbols for which we are making plt entries. The
|
||||
first entry in the procedure linkage table is reserved. */
|
||||
- plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
|
||||
+ plt_index = ((struct elf_or1k_link_hash_entry *) h)->plt_index;
|
||||
plt_addr = plt_base_addr + h->plt.offset;
|
||||
plt_reloc = plt_index * sizeof (Elf32_External_Rela);
|
||||
|
||||
+ large_plt_entry = (elf_or1k_plt_entry_size (plt_index)
|
||||
+ == PLT_ENTRY_SIZE_LARGE);
|
||||
+
|
||||
/* Get the offset into the .got table of the entry that
|
||||
corresponds to this function. Each .got entry is 4 bytes.
|
||||
The first three are reserved. */
|
||||
@@ -2435,27 +2471,57 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
{
|
||||
unsigned pa = ((got_addr >> 13) - (plt_addr >> 13)) & 0x1fffff;
|
||||
unsigned po = (got_addr & 0x1fff);
|
||||
- plt0 = OR1K_ADRP(12) | pa;
|
||||
- plt1 = OR1K_LWZ(12,12) | po;
|
||||
- plt2 = OR1K_ORI0(11) | plt_reloc;
|
||||
+ plt[0] = OR1K_ADRP(12) | pa;
|
||||
+ plt[1] = OR1K_LWZ(12,12) | po;
|
||||
+ plt[2] = OR1K_ORI0(11) | plt_reloc;
|
||||
}
|
||||
else if (bfd_link_pic (info))
|
||||
{
|
||||
- plt0 = OR1K_LWZ(12,16) | got_offset;
|
||||
- plt1 = OR1K_ORI0(11) | plt_reloc;
|
||||
- plt2 = OR1K_NOP;
|
||||
+ if (large_plt_entry)
|
||||
+ {
|
||||
+ unsigned gotha = ((got_offset + 0x8000) >> 16) & 0xffff;
|
||||
+ unsigned got = got_offset & 0xffff;
|
||||
+ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
|
||||
+ unsigned pltrello = plt_reloc & 0xffff;
|
||||
+
|
||||
+ plt[0] = OR1K_MOVHI(12) | gotha;
|
||||
+ plt[1] = OR1K_ADD(12,12,16);
|
||||
+ plt[2] = OR1K_LWZ(12,12) | got;
|
||||
+ plt[3] = OR1K_MOVHI(11) | pltrelhi;
|
||||
+ plt[4] = OR1K_ORI(11,11) | pltrello;
|
||||
+ plt_insn_count = 5;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ plt[0] = OR1K_LWZ(12,16) | got_offset;
|
||||
+ plt[1] = OR1K_ORI0(11) | plt_reloc;
|
||||
+ plt[2] = OR1K_NOP;
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
|
||||
unsigned lo = got_addr & 0xffff;
|
||||
- plt0 = OR1K_MOVHI(12) | ha;
|
||||
- plt1 = OR1K_LWZ(12,12) | lo;
|
||||
- plt2 = OR1K_ORI0(11) | plt_reloc;
|
||||
+ plt[0] = OR1K_MOVHI(12) | ha;
|
||||
+ plt[1] = OR1K_LWZ(12,12) | lo;
|
||||
+ plt[2] = OR1K_ORI0(11) | plt_reloc;
|
||||
+ }
|
||||
+
|
||||
+ /* For large code model we fixup the non-PIC PLT relocation instructions
|
||||
+ here. */
|
||||
+ if (large_plt_entry && !bfd_link_pic (info))
|
||||
+ {
|
||||
+ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
|
||||
+ unsigned pltrello = plt_reloc & 0xffff;
|
||||
+
|
||||
+ plt[2] = OR1K_MOVHI(11) | pltrelhi;
|
||||
+ plt[3] = OR1K_ORI(11,11) | pltrello;
|
||||
+ plt[4] = OR1K_NOP;
|
||||
+ plt_insn_count = 5;
|
||||
}
|
||||
|
||||
or1k_write_plt_entry (output_bfd, splt->contents + h->plt.offset,
|
||||
- plt0, plt1, plt2, OR1K_JR(12));
|
||||
+ OR1K_JR(12), plt, plt_insn_count);
|
||||
|
||||
/* Fill in the entry in the global offset table. We initialize it to
|
||||
point to the top of the plt. This is done to lazy lookup the actual
|
||||
@@ -2779,11 +2845,16 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
|
||||
{
|
||||
asection *splt = htab->root.splt;
|
||||
+ bfd_vma plt_index;
|
||||
+
|
||||
+ /* Track the index of our plt entry for use in calculating size. */
|
||||
+ plt_index = htab->plt_count++;
|
||||
+ ((struct elf_or1k_link_hash_entry *) h)->plt_index = plt_index;
|
||||
|
||||
/* If this is the first .plt entry, make room for the special
|
||||
first entry. */
|
||||
if (splt->size == 0)
|
||||
- splt->size = PLT_ENTRY_SIZE;
|
||||
+ splt->size = elf_or1k_plt_entry_size (plt_index);
|
||||
|
||||
h->plt.offset = splt->size;
|
||||
|
||||
@@ -2800,7 +2871,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
}
|
||||
|
||||
/* Make room for this entry. */
|
||||
- splt->size += PLT_ENTRY_SIZE;
|
||||
+ splt->size += elf_or1k_plt_entry_size (plt_index);
|
||||
|
||||
/* We also need to make an entry in the .got.plt section, which
|
||||
will be placed in the .got section by the linker script. */
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha1.dd b/ld/testsuite/ld-or1k/gotha1.dd
|
||||
new file mode 100644
|
||||
index 00000000000..0ad1f8f5399
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha1.dd
|
||||
@@ -0,0 +1,34 @@
|
||||
+
|
||||
+.*\.x: file format elf32-or1k
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.plt:
|
||||
+
|
||||
+[0-9a-f]+ <\.plt>:
|
||||
+ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
|
||||
+ +[0-9a-f]+: 85 ec [0-9a-f]+ [0-9a-f]+ l\.lwz r15,[0-9]+\(r12\)
|
||||
+ +[0-9a-f]+: 44 00 78 00 l\.jr r15
|
||||
+ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
|
||||
+ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
|
||||
+ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
|
||||
+ +[0-9a-f]+: 44 00 60 00 l\.jr r12
|
||||
+ +[0-9a-f]+: a9 60 00 00 l\.ori r11,r0,0x0
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+[0-9a-f]+ <_start>:
|
||||
+ +[0-9a-f]+: 9c 21 ff fc l\.addi r1,r1,-4
|
||||
+ +[0-9a-f]+: d4 01 48 00 l\.sw 0\(r1\),r9
|
||||
+ +[0-9a-f]+: 04 00 00 02 l\.jal [0-9a-f]+ <_start\+0x10>
|
||||
+ +[0-9a-f]+: 1a 60 00 00 l\.movhi r19,0x0
|
||||
+ +[0-9a-f]+: aa 73 [0-9a-f]+ [0-9a-f]+ l\.ori r19,r19,0x[0-9a-f]+
|
||||
+ +[0-9a-f]+: e2 73 48 00 l\.add r19,r19,r9
|
||||
+ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
|
||||
+ +[0-9a-f]+: e2 31 98 00 l\.add r17,r17,r19
|
||||
+ +[0-9a-f]+: 86 31 00 10 l\.lwz r17,16\(r17\)
|
||||
+ +[0-9a-f]+: 84 71 00 00 l\.lwz r3,0\(r17\)
|
||||
+ +[0-9a-f]+: 07 ff ff f2 l\.jal [0-9a-f]+ <\.plt\+0x10>
|
||||
+ +[0-9a-f]+: 15 00 00 00 l\.nop 0x0
|
||||
+ +[0-9a-f]+: 85 21 00 00 l\.lwz r9,0\(r1\)
|
||||
+ +[0-9a-f]+: 44 00 48 00 l\.jr r9
|
||||
+ +[0-9a-f]+: 9c 21 00 04 l\.addi r1,r1,4
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha1.s b/ld/testsuite/ld-or1k/gotha1.s
|
||||
new file mode 100644
|
||||
index 00000000000..42b16db425c
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha1.s
|
||||
@@ -0,0 +1,24 @@
|
||||
+ .data
|
||||
+ .p2align 16
|
||||
+
|
||||
+ .text
|
||||
+ .globl _start
|
||||
+_start:
|
||||
+ l.addi r1, r1, -4
|
||||
+ l.sw 0(r1), r9
|
||||
+
|
||||
+ l.jal 8
|
||||
+ l.movhi r19, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
|
||||
+ l.ori r19, r19, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
|
||||
+ l.add r19, r19, r9
|
||||
+
|
||||
+ l.movhi r17, gotha(x)
|
||||
+ l.add r17, r17, r19
|
||||
+ l.lwz r17, got(x)(r17)
|
||||
+ l.lwz r3, 0(r17)
|
||||
+
|
||||
+ l.jal plt(func)
|
||||
+ l.nop
|
||||
+ l.lwz r9, 0(r1)
|
||||
+ l.jr r9
|
||||
+ l.addi r1, r1, 4
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha2.dd b/ld/testsuite/ld-or1k/gotha2.dd
|
||||
new file mode 100644
|
||||
index 00000000000..fe09da5466b
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha2.dd
|
||||
@@ -0,0 +1,21 @@
|
||||
+
|
||||
+.*\.x: file format elf32-or1k
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+[0-9a-f]+ <test>:
|
||||
+ +[0-9a-f]+: 9c 21 ff f8 l\.addi r1,r1,-8
|
||||
+ +[0-9a-f]+: d4 01 80 00 l\.sw 0\(r1\),r16
|
||||
+ +[0-9a-f]+: d4 01 48 04 l\.sw 4\(r1\),r9
|
||||
+ +[0-9a-f]+: 04 00 [0-9a-f]+ [0-9a-f]+ l\.jal [0-9a-f]+ <test\+0x14>
|
||||
+ +[0-9a-f]+: 1a 00 00 00 l\.movhi r16,0x0
|
||||
+ +[0-9a-f]+: aa 10 [0-9a-f]+ [0-9a-f]+ l\.ori r16,r16,0x[0-9a-f]+
|
||||
+ +[0-9a-f]+: e2 10 48 00 l\.add r16,r16,r9
|
||||
+ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
|
||||
+ +[0-9a-f]+: e2 31 80 00 l\.add r17,r17,r16
|
||||
+ +[0-9a-f]+: 86 31 00 0c l\.lwz r17,12\(r17\)
|
||||
+ +[0-9a-f]+: 85 21 00 04 l\.lwz r9,4\(r1\)
|
||||
+ +[0-9a-f]+: 86 01 00 00 l\.lwz r16,0\(r1\)
|
||||
+ +[0-9a-f]+: 44 00 48 00 l\.jr r9
|
||||
+ +[0-9a-f]+: 9c 21 00 08 l\.addi r1,r1,8
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha2.s b/ld/testsuite/ld-or1k/gotha2.s
|
||||
new file mode 100644
|
||||
index 00000000000..164b282f2dd
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha2.s
|
||||
@@ -0,0 +1,22 @@
|
||||
+ .section .text
|
||||
+ .align 4
|
||||
+ .global test
|
||||
+ .type test, @function
|
||||
+test:
|
||||
+ l.addi r1, r1, -8
|
||||
+ l.sw 0(r1), r16
|
||||
+ l.sw 4(r1), r9
|
||||
+
|
||||
+ l.jal 8
|
||||
+ l.movhi r16, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
|
||||
+ l.ori r16, r16, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
|
||||
+ l.add r16, r16, r9
|
||||
+
|
||||
+ l.movhi r17, gotha(i)
|
||||
+ l.add r17, r17, r16
|
||||
+ l.lwz r17, got(i)(r17)
|
||||
+
|
||||
+ l.lwz r9, 4(r1)
|
||||
+ l.lwz r16, 0(r1)
|
||||
+ l.jr r9
|
||||
+ l.addi r1, r1, 8
|
||||
diff --git a/ld/testsuite/ld-or1k/or1k.exp b/ld/testsuite/ld-or1k/or1k.exp
|
||||
index 7592e8307c1..8e19ec6c31a 100644
|
||||
--- a/ld/testsuite/ld-or1k/or1k.exp
|
||||
+++ b/ld/testsuite/ld-or1k/or1k.exp
|
||||
@@ -53,6 +53,14 @@ set or1kplttests {
|
||||
"" {plt1.s}
|
||||
{{objdump -dr plt1.x.dd}}
|
||||
"plt1.x"}
|
||||
+ {"gotha exec plt" "tmpdir/libpltlib.so" ""
|
||||
+ "" {gotha1.s}
|
||||
+ {{objdump -dr gotha1.dd}}
|
||||
+ "gotha1.x"}
|
||||
+ {"gotha -fpic -shared" "-fpic -shared" ""
|
||||
+ "" {gotha2.s}
|
||||
+ {{objdump -dr gotha2.dd}}
|
||||
+ "gotha2.x"}
|
||||
}
|
||||
|
||||
# Not implemented yet
|
||||
diff --git a/ld/testsuite/ld-or1k/pltlib.s b/ld/testsuite/ld-or1k/pltlib.s
|
||||
index baf76ca1af7..8b4d7ba48fd 100644
|
||||
--- a/ld/testsuite/ld-or1k/pltlib.s
|
||||
+++ b/ld/testsuite/ld-or1k/pltlib.s
|
||||
@@ -1,5 +1,6 @@
|
||||
.section .data
|
||||
.globl x, y
|
||||
+ .size x, 4
|
||||
x: .long 33
|
||||
y: .long 44
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
From 1659226a96b1daecfd08c057d0d5c39309d207ee Mon Sep 17 00:00:00 2001
|
||||
From: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
Date: Mon, 22 Mar 2021 13:30:07 +0100
|
||||
Subject: [PATCH] bfd/elf32-or1k: fix ld assert
|
||||
|
||||
Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=27624
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 65938e5137..41908f8938 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -2566,11 +2566,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if (h->type == STT_FUNC
|
||||
|| h->needs_plt)
|
||||
{
|
||||
- if (! bfd_link_pic (info)
|
||||
- && !h->def_dynamic
|
||||
- && !h->ref_dynamic
|
||||
- && h->root.type != bfd_link_hash_undefweak
|
||||
- && h->root.type != bfd_link_hash_undefined)
|
||||
+ if (h->plt.refcount <= 0
|
||||
+ || (SYMBOL_CALLS_LOCAL (info, h)
|
||||
+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|
||||
+ && h->root.type == bfd_link_hash_undefweak)))
|
||||
{
|
||||
/* This case can occur if we saw a PLT reloc in an input
|
||||
file, but the symbol was never referred to by a dynamic
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
From b5fdaa85790dff45fd2c3fd15405c16dbc50a074 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:14 +0900
|
||||
Subject: [PATCH] or1k: Fix issue with plt link failure for local calls
|
||||
|
||||
When building protobuf we were seeing the assert failure:
|
||||
|
||||
/home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
|
||||
BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
|
||||
/home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
|
||||
BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
|
||||
/home/giuliobenetti/git/upstream/or1k-binutils-2.36.1/host/lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
|
||||
BFD (GNU Binutils) 2.36.1 assertion fail elf32-or1k.c:2377
|
||||
collect2: error: ld returned 1 exit status
|
||||
|
||||
This failure happens while writing out PLT entries, there is a check
|
||||
"BFD_ASSERT (h->dynindx != -1)" to confirm all plt entries have dynamic
|
||||
symbol attributes. This was failing for symbols that were
|
||||
"forced_local" in previous linking code.
|
||||
|
||||
The fix adds logic to or1k_elf_adjust_dynamic_symbol to identify
|
||||
"forced_local" symbols and exclude them from the the PLT.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 27624
|
||||
* elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Change
|
||||
condition used to cleanup plt entries to cleanup forced local
|
||||
entries.
|
||||
|
||||
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 65938e51378..4f82cc4c667 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -2566,11 +2566,10 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if (h->type == STT_FUNC
|
||||
|| h->needs_plt)
|
||||
{
|
||||
- if (! bfd_link_pic (info)
|
||||
- && !h->def_dynamic
|
||||
- && !h->ref_dynamic
|
||||
- && h->root.type != bfd_link_hash_undefweak
|
||||
- && h->root.type != bfd_link_hash_undefined)
|
||||
+ if (h->plt.refcount <= 0
|
||||
+ || (SYMBOL_CALLS_LOCAL (info, h)
|
||||
+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|
||||
+ && h->root.type == bfd_link_hash_undefweak)))
|
||||
{
|
||||
/* This case can occur if we saw a PLT reloc in an input
|
||||
file, but the symbol was never referred to by a dynamic
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+256
@@ -0,0 +1,256 @@
|
||||
From 141dee7402871c7b3994838c3eddf64a92d67be7 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:15 +0900
|
||||
Subject: [PATCH] or1k: Implement relocation R_OR1K_GOT_AHI16 for gotha()
|
||||
|
||||
The gotha() relocation mnemonic will be outputted by OpenRISC GCC when
|
||||
using the -mcmodel=large option. This relocation is used along with
|
||||
got() to generate 32-bit GOT offsets. This increases the previous GOT
|
||||
offset limit from the previous 16-bit (64K) limit.
|
||||
|
||||
This is needed on large binaries where the GOT grows larger than 64k.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* bfd-in2.h: Add BFD_RELOC_OR1K_GOT_AHI16 relocation.
|
||||
* elf32-or1k.c (or1k_elf_howto_table, or1k_reloc_map): Likewise.
|
||||
(or1k_final_link_relocate, or1k_elf_relocate_section,
|
||||
or1k_elf_check_relocs): Likewise.
|
||||
* libbfd.h (bfd_reloc_code_real_names): Likewise.
|
||||
* reloc.c: Likewise.
|
||||
|
||||
cpu/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* or1k.opc (or1k_imm16_relocs, parse_reloc): Define parse logic
|
||||
for gotha() relocation.
|
||||
|
||||
include/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* elf/or1k.h (elf_or1k_reloc_type): Define R_OR1K_GOT_AHI16 number.
|
||||
|
||||
opcodes/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* or1k-asm.c: Regenerate.
|
||||
|
||||
gas/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* testsuite/gas/or1k/reloc-1.s: Add test for new relocation.
|
||||
* testsuite/gas/or1k/reloc-1.d: Add test result for new
|
||||
relocation.
|
||||
|
||||
Cc: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
|
||||
fixup reloc, add tests
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/bfd-in2.h | 1 +
|
||||
bfd/elf32-or1k.c | 21 ++++++++++++++++++++-
|
||||
bfd/libbfd.h | 1 +
|
||||
bfd/reloc.c | 2 ++
|
||||
cpu/or1k.opc | 7 ++++++-
|
||||
gas/testsuite/gas/or1k/reloc-1.d | 4 +++-
|
||||
gas/testsuite/gas/or1k/reloc-1.s | 4 ++++
|
||||
include/elf/or1k.h | 1 +
|
||||
opcodes/or1k-asm.c | 7 ++++++-
|
||||
9 files changed, 44 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
|
||||
index 7eff85b7eaa..e76b9e7a319 100644
|
||||
--- a/bfd/bfd-in2.h
|
||||
+++ b/bfd/bfd-in2.h
|
||||
@@ -5048,6 +5048,7 @@ then it may be truncated to 8 bits. */
|
||||
BFD_RELOC_OR1K_TLS_TPOFF,
|
||||
BFD_RELOC_OR1K_TLS_DTPOFF,
|
||||
BFD_RELOC_OR1K_TLS_DTPMOD,
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16,
|
||||
|
||||
/* H8 elf Relocations. */
|
||||
BFD_RELOC_H8_DIR16A8,
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 4f82cc4c667..48461854a96 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -808,6 +808,20 @@ static reloc_howto_type or1k_elf_howto_table[] =
|
||||
0, /* Source Mask. */
|
||||
0x03ffffff, /* Dest Mask. */
|
||||
TRUE), /* PC relative offset? */
|
||||
+
|
||||
+ HOWTO (R_OR1K_GOT_AHI16, /* type */
|
||||
+ 16, /* rightshift */
|
||||
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
|
||||
+ 16, /* bitsize */
|
||||
+ FALSE, /* pc_relative */
|
||||
+ 0, /* bitpos */
|
||||
+ complain_overflow_signed, /* complain_on_overflow */
|
||||
+ bfd_elf_generic_reloc, /* special_function */
|
||||
+ "R_OR1K_GOT_AHI16", /* name */
|
||||
+ FALSE, /* partial_inplace */
|
||||
+ 0, /* src_mask */
|
||||
+ 0xffff, /* dst_mask */
|
||||
+ FALSE), /* pcrel_offset */
|
||||
};
|
||||
|
||||
/* Map BFD reloc types to Or1k ELF reloc types. */
|
||||
@@ -871,6 +885,7 @@ static const struct or1k_reloc_map or1k_reloc_map[] =
|
||||
{ BFD_RELOC_OR1K_TLS_IE_LO13, R_OR1K_TLS_IE_LO13 },
|
||||
{ BFD_RELOC_OR1K_SLO13, R_OR1K_SLO13 },
|
||||
{ BFD_RELOC_OR1K_PLTA26, R_OR1K_PLTA26 },
|
||||
+ { BFD_RELOC_OR1K_GOT_AHI16, R_OR1K_GOT_AHI16 },
|
||||
};
|
||||
|
||||
/* tls_type is a mask used to track how each symbol is accessed,
|
||||
@@ -1111,6 +1126,7 @@ or1k_final_link_relocate (reloc_howto_type *howto, bfd *input_bfd,
|
||||
switch (howto->type)
|
||||
{
|
||||
case R_OR1K_AHI16:
|
||||
+ case R_OR1K_GOT_AHI16:
|
||||
case R_OR1K_GOTOFF_AHI16:
|
||||
case R_OR1K_TLS_IE_AHI16:
|
||||
case R_OR1K_TLS_LE_AHI16:
|
||||
@@ -1373,6 +1389,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
}
|
||||
break;
|
||||
|
||||
+ case R_OR1K_GOT_AHI16:
|
||||
case R_OR1K_GOT16:
|
||||
case R_OR1K_GOT_PG21:
|
||||
case R_OR1K_GOT_LO13:
|
||||
@@ -1464,7 +1481,8 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
/* The GOT_PG21 and GOT_LO13 relocs are pc-relative,
|
||||
while the GOT16 reloc is GOT relative. */
|
||||
relocation = got_base + off;
|
||||
- if (r_type == R_OR1K_GOT16)
|
||||
+ if (r_type == R_OR1K_GOT16
|
||||
+ || r_type == R_OR1K_GOT_AHI16)
|
||||
relocation -= got_sym_value;
|
||||
|
||||
/* Addend should be zero. */
|
||||
@@ -1990,6 +2008,7 @@ or1k_elf_check_relocs (bfd *abfd,
|
||||
}
|
||||
break;
|
||||
|
||||
+ case R_OR1K_GOT_AHI16:
|
||||
case R_OR1K_GOT16:
|
||||
case R_OR1K_GOT_PG21:
|
||||
case R_OR1K_GOT_LO13:
|
||||
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
|
||||
index 7271a2ad5a1..e0ee2dafc07 100644
|
||||
--- a/bfd/libbfd.h
|
||||
+++ b/bfd/libbfd.h
|
||||
@@ -2757,6 +2757,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
|
||||
"BFD_RELOC_OR1K_TLS_TPOFF",
|
||||
"BFD_RELOC_OR1K_TLS_DTPOFF",
|
||||
"BFD_RELOC_OR1K_TLS_DTPMOD",
|
||||
+ "BFD_RELOC_OR1K_GOT_AHI16",
|
||||
"BFD_RELOC_H8_DIR16A8",
|
||||
"BFD_RELOC_H8_DIR16R8",
|
||||
"BFD_RELOC_H8_DIR24A8",
|
||||
diff --git a/bfd/reloc.c b/bfd/reloc.c
|
||||
index 4f4b95a0b7f..fe94e0d8f91 100644
|
||||
--- a/bfd/reloc.c
|
||||
+++ b/bfd/reloc.c
|
||||
@@ -6204,6 +6204,8 @@ ENUMX
|
||||
BFD_RELOC_OR1K_GOTPC_HI16
|
||||
ENUMX
|
||||
BFD_RELOC_OR1K_GOTPC_LO16
|
||||
+ENUMX
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16
|
||||
ENUMX
|
||||
BFD_RELOC_OR1K_GOT16
|
||||
ENUMX
|
||||
diff --git a/cpu/or1k.opc b/cpu/or1k.opc
|
||||
index f0adcbb00a5..5d20a1f33a7 100644
|
||||
--- a/cpu/or1k.opc
|
||||
+++ b/cpu/or1k.opc
|
||||
@@ -193,7 +193,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
|
||||
BFD_RELOC_OR1K_GOT_LO13,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
- BFD_RELOC_UNUSED },
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16 },
|
||||
{ BFD_RELOC_OR1K_GOTPC_LO16,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
@@ -296,6 +296,11 @@ parse_reloc (const char **strp)
|
||||
str += 5;
|
||||
cls = RCLASS_TPOFF;
|
||||
}
|
||||
+ else if (strncasecmp (str, "got", 3) == 0)
|
||||
+ {
|
||||
+ str += 3;
|
||||
+ cls = RCLASS_GOT;
|
||||
+ }
|
||||
|
||||
if (strncasecmp (str, "hi(", 3) == 0)
|
||||
{
|
||||
diff --git a/gas/testsuite/gas/or1k/reloc-1.d b/gas/testsuite/gas/or1k/reloc-1.d
|
||||
index d1bcf5608bb..3a001c4ed99 100644
|
||||
--- a/gas/testsuite/gas/or1k/reloc-1.d
|
||||
+++ b/gas/testsuite/gas/or1k/reloc-1.d
|
||||
@@ -68,5 +68,7 @@ OFFSET TYPE VALUE
|
||||
000000ec R_OR1K_LO13 x
|
||||
000000f0 R_OR1K_GOT_LO13 x
|
||||
000000f4 R_OR1K_SLO13 x
|
||||
-
|
||||
+000000f8 R_OR1K_GOT_AHI16 x
|
||||
+000000fc R_OR1K_GOT_AHI16 x
|
||||
+00000100 R_OR1K_GOT_AHI16 x
|
||||
|
||||
diff --git a/gas/testsuite/gas/or1k/reloc-1.s b/gas/testsuite/gas/or1k/reloc-1.s
|
||||
index e76abef6532..562609aa869 100644
|
||||
--- a/gas/testsuite/gas/or1k/reloc-1.s
|
||||
+++ b/gas/testsuite/gas/or1k/reloc-1.s
|
||||
@@ -74,3 +74,7 @@
|
||||
l.lbz r5,po(x)(r3)
|
||||
l.lbz r5,gotpo(x)(r3)
|
||||
l.sb po(x)(r3),r6
|
||||
+
|
||||
+ l.movhi r4,gotha(x)
|
||||
+ l.ori r3,r4,gotha(x)
|
||||
+ l.addi r3,r4,gotha(x)
|
||||
diff --git a/include/elf/or1k.h b/include/elf/or1k.h
|
||||
index 7f281481061..69ab90584a2 100644
|
||||
--- a/include/elf/or1k.h
|
||||
+++ b/include/elf/or1k.h
|
||||
@@ -77,6 +77,7 @@ START_RELOC_NUMBERS (elf_or1k_reloc_type)
|
||||
RELOC_NUMBER (R_OR1K_TLS_IE_LO13, 51)
|
||||
RELOC_NUMBER (R_OR1K_SLO13, 52)
|
||||
RELOC_NUMBER (R_OR1K_PLTA26, 53)
|
||||
+ RELOC_NUMBER (R_OR1K_GOT_AHI16, 54)
|
||||
END_RELOC_NUMBERS (R_OR1K_max)
|
||||
|
||||
#define EF_OR1K_NODELAY (1UL << 0)
|
||||
diff --git a/opcodes/or1k-asm.c b/opcodes/or1k-asm.c
|
||||
index 045ab6230b6..fdccf67f9e1 100644
|
||||
--- a/opcodes/or1k-asm.c
|
||||
+++ b/opcodes/or1k-asm.c
|
||||
@@ -177,7 +177,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
|
||||
BFD_RELOC_OR1K_GOT_LO13,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
- BFD_RELOC_UNUSED },
|
||||
+ BFD_RELOC_OR1K_GOT_AHI16 },
|
||||
{ BFD_RELOC_OR1K_GOTPC_LO16,
|
||||
BFD_RELOC_UNUSED,
|
||||
BFD_RELOC_UNUSED,
|
||||
@@ -280,6 +280,11 @@ parse_reloc (const char **strp)
|
||||
str += 5;
|
||||
cls = RCLASS_TPOFF;
|
||||
}
|
||||
+ else if (strncasecmp (str, "got", 3) == 0)
|
||||
+ {
|
||||
+ str += 3;
|
||||
+ cls = RCLASS_GOT;
|
||||
+ }
|
||||
|
||||
if (strncasecmp (str, "hi(", 3) == 0)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
From de914df5f2ba23a9f6f1fbf6efdc22e1b045901c Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:16 +0900
|
||||
Subject: [PATCH] or1k: Avoid R_OR1K_GOT16 overflow failures in presence of
|
||||
R_OR1K_GOT_AHI16
|
||||
|
||||
Now that we support R_OR1K_GOT_AHI16 we can relax the R_OR1K_GOT16
|
||||
overflow validation check if the section has R_OR1K_GOT_AHI16.
|
||||
|
||||
We cannot simple disable R_OR1K_GOT16 overflow validation as there will
|
||||
still be binaries that will have only R_OR1K_GOT16. The
|
||||
R_OR1K_GOT_AHI16 relocation will only be added by GCC when building with
|
||||
the option -mcmodel=large.
|
||||
|
||||
This assumes that R_OR1K_GOT_AHI16 will come before R_OR1K_GOT16, which
|
||||
is the code pattern that will be emitted by GCC.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 21464
|
||||
* elf32-or1k.c (or1k_elf_relocate_section): Relax R_OR1K_GOT16
|
||||
overflow check if we have R_OR1K_GOT_AHI16 followed by
|
||||
R_OR1K_GOT16.
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 48461854a96..44e67f2b84b 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -1278,6 +1278,7 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
asection *sgot, *splt;
|
||||
bfd_vma plt_base, got_base, got_sym_value;
|
||||
bfd_boolean ret_val = TRUE;
|
||||
+ bfd_boolean saw_gotha = FALSE;
|
||||
|
||||
if (htab == NULL)
|
||||
return FALSE;
|
||||
@@ -1485,6 +1486,16 @@ or1k_elf_relocate_section (bfd *output_bfd,
|
||||
|| r_type == R_OR1K_GOT_AHI16)
|
||||
relocation -= got_sym_value;
|
||||
|
||||
+ if (r_type == R_OR1K_GOT_AHI16)
|
||||
+ saw_gotha = TRUE;
|
||||
+
|
||||
+ /* If we have a R_OR1K_GOT16 followed by a R_OR1K_GOT_AHI16
|
||||
+ relocation we assume the code is doing the right thing to avoid
|
||||
+ overflows. Here we mask the lower 16-bit of the relocation to
|
||||
+ avoid overflow validation failures. */
|
||||
+ if (r_type == R_OR1K_GOT16 && saw_gotha)
|
||||
+ relocation &= 0xffff;
|
||||
+
|
||||
/* Addend should be zero. */
|
||||
if (rel->r_addend != 0)
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+500
@@ -0,0 +1,500 @@
|
||||
From 4a7b357d0c802685bee7706bafb9702c821286e1 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:02:17 +0900
|
||||
Subject: [PATCH] or1k: Support large plt_relocs when generating plt
|
||||
entries
|
||||
|
||||
The current PLT generation code will generate invalid code when the PLT
|
||||
relocation offset exceeds 64k. This fixes the issue by detecting large
|
||||
plt_reloc offsets and generare code sequences to create larger plt
|
||||
relocations.
|
||||
|
||||
The "large" plt code needs 2 extra instructions to create 32-bit offsets.
|
||||
|
||||
bfd/ChangeLog:
|
||||
|
||||
PR 27746
|
||||
* elf32-or1k.c (PLT_ENTRY_SIZE_LARGE, PLT_MAX_INSN_COUNT,
|
||||
OR1K_ADD, OR1K_ORI): New macros to help with plt creation.
|
||||
(elf_or1k_link_hash_table): New field plt_count.
|
||||
(elf_or1k_link_hash_entry): New field plt_index.
|
||||
(elf_or1k_plt_entry_size): New function.
|
||||
(or1k_write_plt_entry): Update to support variable size PLTs.
|
||||
(or1k_elf_finish_dynamic_sections): Use new or1k_write_plt_entry
|
||||
API.
|
||||
(or1k_elf_finish_dynamic_symbol): Update to write large PLTs
|
||||
when needed.
|
||||
(allocate_dynrelocs): Use elf_or1k_plt_entry_size to account for
|
||||
PLT size.
|
||||
|
||||
ld/ChangeLog:
|
||||
|
||||
PR 27746
|
||||
testsuite/ld-or1k/or1k.exp (or1kplttests): Add tests for linking
|
||||
along with gotha() relocations.
|
||||
testsuite/ld-or1k/gotha1.dd: New file.
|
||||
testsuite/ld-or1k/gotha1.s: New file.
|
||||
testsuite/ld-or1k/gotha2.dd: New file.
|
||||
testsuite/ld-or1k/gotha2.s: New file
|
||||
testsuite/ld-or1k/pltlib.s (x): Define size to avoid link
|
||||
failure.
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
bfd/elf32-or1k.c | 149 ++++++++++++++++++++++++---------
|
||||
ld/testsuite/ld-or1k/gotha1.dd | 34 ++++++++
|
||||
ld/testsuite/ld-or1k/gotha1.s | 24 ++++++
|
||||
ld/testsuite/ld-or1k/gotha2.dd | 21 +++++
|
||||
ld/testsuite/ld-or1k/gotha2.s | 22 +++++
|
||||
ld/testsuite/ld-or1k/or1k.exp | 8 ++
|
||||
ld/testsuite/ld-or1k/pltlib.s | 1 +
|
||||
7 files changed, 220 insertions(+), 39 deletions(-)
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha1.dd
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha1.s
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha2.dd
|
||||
create mode 100644 ld/testsuite/ld-or1k/gotha2.s
|
||||
|
||||
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
|
||||
index 44e67f2b84b..3da68e52425 100644
|
||||
--- a/bfd/elf32-or1k.c
|
||||
+++ b/bfd/elf32-or1k.c
|
||||
@@ -30,10 +30,14 @@
|
||||
#define N_ONES(X) (((bfd_vma)2 << (X)) - 1)
|
||||
|
||||
#define PLT_ENTRY_SIZE 16
|
||||
+#define PLT_ENTRY_SIZE_LARGE (6*4)
|
||||
+#define PLT_MAX_INSN_COUNT 6
|
||||
|
||||
#define OR1K_MOVHI(D) (0x18000000 | (D << 21))
|
||||
#define OR1K_ADRP(D) (0x08000000 | (D << 21))
|
||||
#define OR1K_LWZ(D,A) (0x84000000 | (D << 21) | (A << 16))
|
||||
+#define OR1K_ADD(D,A,B) (0xE0000000 | (D << 21) | (A << 16) | (B << 11))
|
||||
+#define OR1K_ORI(D,A) (0xA8000000 | (D << 21) | (A << 16))
|
||||
#define OR1K_ORI0(D) (0xA8000000 | (D << 21))
|
||||
#define OR1K_JR(B) (0x44000000 | (B << 11))
|
||||
#define OR1K_NOP 0x15000000
|
||||
@@ -907,6 +911,8 @@ struct elf_or1k_link_hash_entry
|
||||
{
|
||||
struct elf_link_hash_entry root;
|
||||
|
||||
+ /* For calculating PLT size. */
|
||||
+ bfd_vma plt_index;
|
||||
/* Track type of TLS access. */
|
||||
unsigned char tls_type;
|
||||
};
|
||||
@@ -931,9 +937,20 @@ struct elf_or1k_link_hash_table
|
||||
{
|
||||
struct elf_link_hash_table root;
|
||||
|
||||
+ bfd_vma plt_count;
|
||||
bfd_boolean saw_plta;
|
||||
};
|
||||
|
||||
+static size_t
|
||||
+elf_or1k_plt_entry_size (bfd_vma plt_index)
|
||||
+{
|
||||
+ bfd_vma plt_reloc;
|
||||
+
|
||||
+ plt_reloc = plt_index * sizeof (Elf32_External_Rela);
|
||||
+
|
||||
+ return (plt_reloc > 0xffff) ? PLT_ENTRY_SIZE_LARGE : PLT_ENTRY_SIZE;
|
||||
+}
|
||||
+
|
||||
/* Get the ELF linker hash table from a link_info structure. */
|
||||
#define or1k_elf_hash_table(p) \
|
||||
((is_elf_hash_table ((p)->hash) \
|
||||
@@ -2222,33 +2239,46 @@ or1k_elf_check_relocs (bfd *abfd,
|
||||
}
|
||||
|
||||
static void
|
||||
-or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insn1,
|
||||
- unsigned insn2, unsigned insn3, unsigned insnj)
|
||||
+or1k_write_plt_entry (bfd *output_bfd, bfd_byte *contents, unsigned insnj,
|
||||
+ unsigned insns[], size_t insn_count)
|
||||
{
|
||||
unsigned nodelay = elf_elfheader (output_bfd)->e_flags & EF_OR1K_NODELAY;
|
||||
- unsigned insn4;
|
||||
+ unsigned output_insns[PLT_MAX_INSN_COUNT];
|
||||
+
|
||||
+ /* Copy instructions into the output buffer. */
|
||||
+ for (size_t i = 0; i < insn_count; i++)
|
||||
+ output_insns[i] = insns[i];
|
||||
|
||||
/* Honor the no-delay-slot setting. */
|
||||
- if (insn3 == OR1K_NOP)
|
||||
+ if (insns[insn_count-1] == OR1K_NOP)
|
||||
{
|
||||
- insn4 = insn3;
|
||||
+ unsigned slot1, slot2;
|
||||
+
|
||||
if (nodelay)
|
||||
- insn3 = insnj;
|
||||
+ slot1 = insns[insn_count-2], slot2 = insnj;
|
||||
else
|
||||
- insn3 = insn2, insn2 = insnj;
|
||||
+ slot1 = insnj, slot2 = insns[insn_count-2];
|
||||
+
|
||||
+ output_insns[insn_count-2] = slot1;
|
||||
+ output_insns[insn_count-1] = slot2;
|
||||
+ output_insns[insn_count] = OR1K_NOP;
|
||||
}
|
||||
else
|
||||
{
|
||||
+ unsigned slot1, slot2;
|
||||
+
|
||||
if (nodelay)
|
||||
- insn4 = insnj;
|
||||
+ slot1 = insns[insn_count-1], slot2 = insnj;
|
||||
else
|
||||
- insn4 = insn3, insn3 = insnj;
|
||||
+ slot1 = insnj, slot2 = insns[insn_count-1];
|
||||
+
|
||||
+ output_insns[insn_count-1] = slot1;
|
||||
+ output_insns[insn_count] = slot2;
|
||||
}
|
||||
|
||||
- bfd_put_32 (output_bfd, insn1, contents);
|
||||
- bfd_put_32 (output_bfd, insn2, contents + 4);
|
||||
- bfd_put_32 (output_bfd, insn3, contents + 8);
|
||||
- bfd_put_32 (output_bfd, insn4, contents + 12);
|
||||
+ /* Write out the output buffer. */
|
||||
+ for (size_t i = 0; i < (insn_count+1); i++)
|
||||
+ bfd_put_32 (output_bfd, output_insns[i], contents + (i*4));
|
||||
}
|
||||
|
||||
/* Finish up the dynamic sections. */
|
||||
@@ -2315,7 +2345,8 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
|
||||
splt = htab->root.splt;
|
||||
if (splt && splt->size > 0)
|
||||
{
|
||||
- unsigned plt0, plt1, plt2;
|
||||
+ unsigned plt[PLT_MAX_INSN_COUNT];
|
||||
+ size_t plt_insn_count = 3;
|
||||
bfd_vma got_addr = sgot->output_section->vma + sgot->output_offset;
|
||||
|
||||
/* Note we force 16 byte alignment on the .got, so that
|
||||
@@ -2326,27 +2357,27 @@ or1k_elf_finish_dynamic_sections (bfd *output_bfd,
|
||||
bfd_vma pc = splt->output_section->vma + splt->output_offset;
|
||||
unsigned pa = ((got_addr >> 13) - (pc >> 13)) & 0x1fffff;
|
||||
unsigned po = got_addr & 0x1fff;
|
||||
- plt0 = OR1K_ADRP(12) | pa;
|
||||
- plt1 = OR1K_LWZ(15,12) | (po + 8);
|
||||
- plt2 = OR1K_LWZ(12,12) | (po + 4);
|
||||
+ plt[0] = OR1K_ADRP(12) | pa;
|
||||
+ plt[1] = OR1K_LWZ(15,12) | (po + 8);
|
||||
+ plt[2] = OR1K_LWZ(12,12) | (po + 4);
|
||||
}
|
||||
else if (bfd_link_pic (info))
|
||||
{
|
||||
- plt0 = OR1K_LWZ(15, 16) | 8; /* .got+8 */
|
||||
- plt1 = OR1K_LWZ(12, 16) | 4; /* .got+4 */
|
||||
- plt2 = OR1K_NOP;
|
||||
+ plt[0] = OR1K_LWZ(15, 16) | 8; /* .got+8 */
|
||||
+ plt[1] = OR1K_LWZ(12, 16) | 4; /* .got+4 */
|
||||
+ plt[2] = OR1K_NOP;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
|
||||
unsigned lo = got_addr & 0xffff;
|
||||
- plt0 = OR1K_MOVHI(12) | ha;
|
||||
- plt1 = OR1K_LWZ(15,12) | (lo + 8);
|
||||
- plt2 = OR1K_LWZ(12,12) | (lo + 4);
|
||||
+ plt[0] = OR1K_MOVHI(12) | ha;
|
||||
+ plt[1] = OR1K_LWZ(15,12) | (lo + 8);
|
||||
+ plt[2] = OR1K_LWZ(12,12) | (lo + 4);
|
||||
}
|
||||
|
||||
- or1k_write_plt_entry (output_bfd, splt->contents,
|
||||
- plt0, plt1, plt2, OR1K_JR(15));
|
||||
+ or1k_write_plt_entry (output_bfd, splt->contents, OR1K_JR(15),
|
||||
+ plt, plt_insn_count);
|
||||
|
||||
elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
|
||||
}
|
||||
@@ -2389,7 +2420,8 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
|
||||
if (h->plt.offset != (bfd_vma) -1)
|
||||
{
|
||||
- unsigned int plt0, plt1, plt2;
|
||||
+ unsigned int plt[PLT_MAX_INSN_COUNT];
|
||||
+ size_t plt_insn_count = 3;
|
||||
asection *splt;
|
||||
asection *sgot;
|
||||
asection *srela;
|
||||
@@ -2401,6 +2433,7 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
bfd_vma got_offset;
|
||||
bfd_vma got_addr;
|
||||
Elf_Internal_Rela rela;
|
||||
+ bfd_boolean large_plt_entry;
|
||||
|
||||
/* This symbol has an entry in the procedure linkage table. Set
|
||||
it up. */
|
||||
@@ -2418,10 +2451,13 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
corresponds to this symbol. This is the index of this symbol
|
||||
in all the symbols for which we are making plt entries. The
|
||||
first entry in the procedure linkage table is reserved. */
|
||||
- plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
|
||||
+ plt_index = ((struct elf_or1k_link_hash_entry *) h)->plt_index;
|
||||
plt_addr = plt_base_addr + h->plt.offset;
|
||||
plt_reloc = plt_index * sizeof (Elf32_External_Rela);
|
||||
|
||||
+ large_plt_entry = (elf_or1k_plt_entry_size (plt_index)
|
||||
+ == PLT_ENTRY_SIZE_LARGE);
|
||||
+
|
||||
/* Get the offset into the .got table of the entry that
|
||||
corresponds to this function. Each .got entry is 4 bytes.
|
||||
The first three are reserved. */
|
||||
@@ -2433,27 +2469,57 @@ or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
{
|
||||
unsigned pa = ((got_addr >> 13) - (plt_addr >> 13)) & 0x1fffff;
|
||||
unsigned po = (got_addr & 0x1fff);
|
||||
- plt0 = OR1K_ADRP(12) | pa;
|
||||
- plt1 = OR1K_LWZ(12,12) | po;
|
||||
- plt2 = OR1K_ORI0(11) | plt_reloc;
|
||||
+ plt[0] = OR1K_ADRP(12) | pa;
|
||||
+ plt[1] = OR1K_LWZ(12,12) | po;
|
||||
+ plt[2] = OR1K_ORI0(11) | plt_reloc;
|
||||
}
|
||||
else if (bfd_link_pic (info))
|
||||
{
|
||||
- plt0 = OR1K_LWZ(12,16) | got_offset;
|
||||
- plt1 = OR1K_ORI0(11) | plt_reloc;
|
||||
- plt2 = OR1K_NOP;
|
||||
+ if (large_plt_entry)
|
||||
+ {
|
||||
+ unsigned gotha = ((got_offset + 0x8000) >> 16) & 0xffff;
|
||||
+ unsigned got = got_offset & 0xffff;
|
||||
+ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
|
||||
+ unsigned pltrello = plt_reloc & 0xffff;
|
||||
+
|
||||
+ plt[0] = OR1K_MOVHI(12) | gotha;
|
||||
+ plt[1] = OR1K_ADD(12,12,16);
|
||||
+ plt[2] = OR1K_LWZ(12,12) | got;
|
||||
+ plt[3] = OR1K_MOVHI(11) | pltrelhi;
|
||||
+ plt[4] = OR1K_ORI(11,11) | pltrello;
|
||||
+ plt_insn_count = 5;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ plt[0] = OR1K_LWZ(12,16) | got_offset;
|
||||
+ plt[1] = OR1K_ORI0(11) | plt_reloc;
|
||||
+ plt[2] = OR1K_NOP;
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned ha = ((got_addr + 0x8000) >> 16) & 0xffff;
|
||||
unsigned lo = got_addr & 0xffff;
|
||||
- plt0 = OR1K_MOVHI(12) | ha;
|
||||
- plt1 = OR1K_LWZ(12,12) | lo;
|
||||
- plt2 = OR1K_ORI0(11) | plt_reloc;
|
||||
+ plt[0] = OR1K_MOVHI(12) | ha;
|
||||
+ plt[1] = OR1K_LWZ(12,12) | lo;
|
||||
+ plt[2] = OR1K_ORI0(11) | plt_reloc;
|
||||
+ }
|
||||
+
|
||||
+ /* For large code model we fixup the non-PIC PLT relocation instructions
|
||||
+ here. */
|
||||
+ if (large_plt_entry && !bfd_link_pic (info))
|
||||
+ {
|
||||
+ unsigned pltrelhi = (plt_reloc >> 16) & 0xffff;
|
||||
+ unsigned pltrello = plt_reloc & 0xffff;
|
||||
+
|
||||
+ plt[2] = OR1K_MOVHI(11) | pltrelhi;
|
||||
+ plt[3] = OR1K_ORI(11,11) | pltrello;
|
||||
+ plt[4] = OR1K_NOP;
|
||||
+ plt_insn_count = 5;
|
||||
}
|
||||
|
||||
or1k_write_plt_entry (output_bfd, splt->contents + h->plt.offset,
|
||||
- plt0, plt1, plt2, OR1K_JR(12));
|
||||
+ OR1K_JR(12), plt, plt_insn_count);
|
||||
|
||||
/* Fill in the entry in the global offset table. We initialize it to
|
||||
point to the top of the plt. This is done to lazy lookup the actual
|
||||
@@ -2777,11 +2843,16 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
|
||||
{
|
||||
asection *splt = htab->root.splt;
|
||||
+ bfd_vma plt_index;
|
||||
+
|
||||
+ /* Track the index of our plt entry for use in calculating size. */
|
||||
+ plt_index = htab->plt_count++;
|
||||
+ ((struct elf_or1k_link_hash_entry *) h)->plt_index = plt_index;
|
||||
|
||||
/* If this is the first .plt entry, make room for the special
|
||||
first entry. */
|
||||
if (splt->size == 0)
|
||||
- splt->size = PLT_ENTRY_SIZE;
|
||||
+ splt->size = elf_or1k_plt_entry_size (plt_index);
|
||||
|
||||
h->plt.offset = splt->size;
|
||||
|
||||
@@ -2798,7 +2869,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
}
|
||||
|
||||
/* Make room for this entry. */
|
||||
- splt->size += PLT_ENTRY_SIZE;
|
||||
+ splt->size += elf_or1k_plt_entry_size (plt_index);
|
||||
|
||||
/* We also need to make an entry in the .got.plt section, which
|
||||
will be placed in the .got section by the linker script. */
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha1.dd b/ld/testsuite/ld-or1k/gotha1.dd
|
||||
new file mode 100644
|
||||
index 00000000000..0ad1f8f5399
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha1.dd
|
||||
@@ -0,0 +1,34 @@
|
||||
+
|
||||
+.*\.x: file format elf32-or1k
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.plt:
|
||||
+
|
||||
+[0-9a-f]+ <\.plt>:
|
||||
+ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
|
||||
+ +[0-9a-f]+: 85 ec [0-9a-f]+ [0-9a-f]+ l\.lwz r15,[0-9]+\(r12\)
|
||||
+ +[0-9a-f]+: 44 00 78 00 l\.jr r15
|
||||
+ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
|
||||
+ +[0-9a-f]+: 19 80 00 00 l\.movhi r12,0x0
|
||||
+ +[0-9a-f]+: 85 8c [0-9a-f]+ [0-9a-f]+ l\.lwz r12,[0-9]+\(r12\)
|
||||
+ +[0-9a-f]+: 44 00 60 00 l\.jr r12
|
||||
+ +[0-9a-f]+: a9 60 00 00 l\.ori r11,r0,0x0
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+[0-9a-f]+ <_start>:
|
||||
+ +[0-9a-f]+: 9c 21 ff fc l\.addi r1,r1,-4
|
||||
+ +[0-9a-f]+: d4 01 48 00 l\.sw 0\(r1\),r9
|
||||
+ +[0-9a-f]+: 04 00 00 02 l\.jal [0-9a-f]+ <_start\+0x10>
|
||||
+ +[0-9a-f]+: 1a 60 00 00 l\.movhi r19,0x0
|
||||
+ +[0-9a-f]+: aa 73 [0-9a-f]+ [0-9a-f]+ l\.ori r19,r19,0x[0-9a-f]+
|
||||
+ +[0-9a-f]+: e2 73 48 00 l\.add r19,r19,r9
|
||||
+ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
|
||||
+ +[0-9a-f]+: e2 31 98 00 l\.add r17,r17,r19
|
||||
+ +[0-9a-f]+: 86 31 00 10 l\.lwz r17,16\(r17\)
|
||||
+ +[0-9a-f]+: 84 71 00 00 l\.lwz r3,0\(r17\)
|
||||
+ +[0-9a-f]+: 07 ff ff f2 l\.jal [0-9a-f]+ <\.plt\+0x10>
|
||||
+ +[0-9a-f]+: 15 00 00 00 l\.nop 0x0
|
||||
+ +[0-9a-f]+: 85 21 00 00 l\.lwz r9,0\(r1\)
|
||||
+ +[0-9a-f]+: 44 00 48 00 l\.jr r9
|
||||
+ +[0-9a-f]+: 9c 21 00 04 l\.addi r1,r1,4
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha1.s b/ld/testsuite/ld-or1k/gotha1.s
|
||||
new file mode 100644
|
||||
index 00000000000..42b16db425c
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha1.s
|
||||
@@ -0,0 +1,24 @@
|
||||
+ .data
|
||||
+ .p2align 16
|
||||
+
|
||||
+ .text
|
||||
+ .globl _start
|
||||
+_start:
|
||||
+ l.addi r1, r1, -4
|
||||
+ l.sw 0(r1), r9
|
||||
+
|
||||
+ l.jal 8
|
||||
+ l.movhi r19, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
|
||||
+ l.ori r19, r19, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
|
||||
+ l.add r19, r19, r9
|
||||
+
|
||||
+ l.movhi r17, gotha(x)
|
||||
+ l.add r17, r17, r19
|
||||
+ l.lwz r17, got(x)(r17)
|
||||
+ l.lwz r3, 0(r17)
|
||||
+
|
||||
+ l.jal plt(func)
|
||||
+ l.nop
|
||||
+ l.lwz r9, 0(r1)
|
||||
+ l.jr r9
|
||||
+ l.addi r1, r1, 4
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha2.dd b/ld/testsuite/ld-or1k/gotha2.dd
|
||||
new file mode 100644
|
||||
index 00000000000..fe09da5466b
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha2.dd
|
||||
@@ -0,0 +1,21 @@
|
||||
+
|
||||
+.*\.x: file format elf32-or1k
|
||||
+
|
||||
+
|
||||
+Disassembly of section \.text:
|
||||
+
|
||||
+[0-9a-f]+ <test>:
|
||||
+ +[0-9a-f]+: 9c 21 ff f8 l\.addi r1,r1,-8
|
||||
+ +[0-9a-f]+: d4 01 80 00 l\.sw 0\(r1\),r16
|
||||
+ +[0-9a-f]+: d4 01 48 04 l\.sw 4\(r1\),r9
|
||||
+ +[0-9a-f]+: 04 00 [0-9a-f]+ [0-9a-f]+ l\.jal [0-9a-f]+ <test\+0x14>
|
||||
+ +[0-9a-f]+: 1a 00 00 00 l\.movhi r16,0x0
|
||||
+ +[0-9a-f]+: aa 10 [0-9a-f]+ [0-9a-f]+ l\.ori r16,r16,0x[0-9a-f]+
|
||||
+ +[0-9a-f]+: e2 10 48 00 l\.add r16,r16,r9
|
||||
+ +[0-9a-f]+: 1a 20 00 00 l\.movhi r17,0x0
|
||||
+ +[0-9a-f]+: e2 31 80 00 l\.add r17,r17,r16
|
||||
+ +[0-9a-f]+: 86 31 00 0c l\.lwz r17,12\(r17\)
|
||||
+ +[0-9a-f]+: 85 21 00 04 l\.lwz r9,4\(r1\)
|
||||
+ +[0-9a-f]+: 86 01 00 00 l\.lwz r16,0\(r1\)
|
||||
+ +[0-9a-f]+: 44 00 48 00 l\.jr r9
|
||||
+ +[0-9a-f]+: 9c 21 00 08 l\.addi r1,r1,8
|
||||
diff --git a/ld/testsuite/ld-or1k/gotha2.s b/ld/testsuite/ld-or1k/gotha2.s
|
||||
new file mode 100644
|
||||
index 00000000000..164b282f2dd
|
||||
--- /dev/null
|
||||
+++ b/ld/testsuite/ld-or1k/gotha2.s
|
||||
@@ -0,0 +1,22 @@
|
||||
+ .section .text
|
||||
+ .align 4
|
||||
+ .global test
|
||||
+ .type test, @function
|
||||
+test:
|
||||
+ l.addi r1, r1, -8
|
||||
+ l.sw 0(r1), r16
|
||||
+ l.sw 4(r1), r9
|
||||
+
|
||||
+ l.jal 8
|
||||
+ l.movhi r16, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
|
||||
+ l.ori r16, r16, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
|
||||
+ l.add r16, r16, r9
|
||||
+
|
||||
+ l.movhi r17, gotha(i)
|
||||
+ l.add r17, r17, r16
|
||||
+ l.lwz r17, got(i)(r17)
|
||||
+
|
||||
+ l.lwz r9, 4(r1)
|
||||
+ l.lwz r16, 0(r1)
|
||||
+ l.jr r9
|
||||
+ l.addi r1, r1, 8
|
||||
diff --git a/ld/testsuite/ld-or1k/or1k.exp b/ld/testsuite/ld-or1k/or1k.exp
|
||||
index 8bb943aacc9..f10949e89aa 100644
|
||||
--- a/ld/testsuite/ld-or1k/or1k.exp
|
||||
+++ b/ld/testsuite/ld-or1k/or1k.exp
|
||||
@@ -53,6 +53,14 @@ set or1kplttests {
|
||||
"" {plt1.s}
|
||||
{{objdump -dr plt1.x.dd}}
|
||||
"plt1.x"}
|
||||
+ {"gotha exec plt" "tmpdir/libpltlib.so" ""
|
||||
+ "" {gotha1.s}
|
||||
+ {{objdump -dr gotha1.dd}}
|
||||
+ "gotha1.x"}
|
||||
+ {"gotha -fpic -shared" "-fpic -shared" ""
|
||||
+ "" {gotha2.s}
|
||||
+ {{objdump -dr gotha2.dd}}
|
||||
+ "gotha2.x"}
|
||||
}
|
||||
|
||||
# Not implemented yet
|
||||
diff --git a/ld/testsuite/ld-or1k/pltlib.s b/ld/testsuite/ld-or1k/pltlib.s
|
||||
index baf76ca1af7..8b4d7ba48fd 100644
|
||||
--- a/ld/testsuite/ld-or1k/pltlib.s
|
||||
+++ b/ld/testsuite/ld-or1k/pltlib.s
|
||||
@@ -1,5 +1,6 @@
|
||||
.section .data
|
||||
.globl x, y
|
||||
+ .size x, 4
|
||||
x: .long 33
|
||||
y: .long 44
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -8,6 +8,7 @@ BIRD_VERSION = 2.0.7
|
||||
BIRD_SITE = ftp://bird.network.cz/pub/bird
|
||||
BIRD_LICENSE = GPL-2.0+
|
||||
BIRD_LICENSE_FILES = README
|
||||
BIRD_CPE_ID_VENDOR = nic
|
||||
BIRD_DEPENDENCIES = host-flex host-bison
|
||||
|
||||
ifeq ($(BR2_PACKAGE_BIRD_CLIENT),y)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# From https://bitcoincore.org/bin/bitcoin-core-0.21.0/SHA256SUMS.asc
|
||||
sha256 1a91202c62ee49fb64d57a52b8d6d01cd392fffcbef257b573800f9289655f37 bitcoin-0.21.0.tar.gz
|
||||
# From https://bitcoincore.org/bin/bitcoin-core-0.21.1/SHA256SUMS.asc
|
||||
sha256 caff23449220cf45753f312cefede53a9eac64000bb300797916526236b6a1e0 bitcoin-0.21.1.tar.gz
|
||||
|
||||
# Hash for license file
|
||||
sha256 96fe807030b21f88305adc32af62f9aa19915f2783509fd6f52aea02cf83f644 COPYING
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
BITCOIN_VERSION = 0.21.0
|
||||
BITCOIN_VERSION = 0.21.1
|
||||
BITCOIN_SITE = https://bitcoincore.org/bin/bitcoin-core-$(BITCOIN_VERSION)
|
||||
BITCOIN_AUTORECONF = YES
|
||||
BITCOIN_LICENSE = MIT
|
||||
|
||||
@@ -2,11 +2,14 @@ config BR2_PACKAGE_BULLET
|
||||
bool "bullet"
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on !BR2_STATIC_LIBS # dlfcn.h
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
depends on BR2_USE_WCHAR
|
||||
help
|
||||
Bullet is a Collision Detection and Rigid Body Dynamics
|
||||
Library.
|
||||
|
||||
http://bulletphysics.org
|
||||
|
||||
comment "bullet needs a toolchain w/ C++, dynamic library"
|
||||
depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS
|
||||
comment "bullet needs a toolchain w/ C++, dynamic library, threads, wchar"
|
||||
depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || \
|
||||
!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From c347aeb43775109cbc2824b99cb10b1b3440c191 Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Mon, 17 May 2021 21:27:11 +0200
|
||||
Subject: [PATCH] server/CMakeLists.txt: don't override CMAKE_EXE_LINKER_FLAGS
|
||||
|
||||
Don't override CMAKE_EXE_LINKER_FLAGS as this could break the build if
|
||||
CMAKE_EXE_LINKER_FLAGS is already set by the user (for example to pass
|
||||
-latomic)
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
[Upstream status: https://github.com/cutelyst/cutelyst/pull/312]
|
||||
---
|
||||
wsgi/CMakeLists.txt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt
|
||||
index ec5689f7..1ed56859 100644
|
||||
--- a/wsgi/CMakeLists.txt
|
||||
+++ b/wsgi/CMakeLists.txt
|
||||
@@ -95,7 +95,7 @@ install(TARGETS Cutelyst${PROJECT_VERSION_MAJOR}Qt${QT_VERSION_MAJOR}Server
|
||||
cxx_generalized_initializers
|
||||
)
|
||||
if (JEMALLOC_FOUND)
|
||||
- set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} " -Wl,--no-as-needed")
|
||||
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-as-needed")
|
||||
target_link_libraries(cutelyst-wsgi2 PRIVATE ${JEMALLOC_LIBRARIES})
|
||||
endif()
|
||||
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -9,7 +9,7 @@ DHCP_SITE = http://ftp.isc.org/isc/dhcp/$(DHCP_VERSION)
|
||||
DHCP_INSTALL_STAGING = YES
|
||||
DHCP_LICENSE = MPL-2.0
|
||||
DHCP_LICENSE_FILES = LICENSE
|
||||
DHCP_DEPENDENCIES = bind
|
||||
DHCP_DEPENDENCIES = bind host-gawk
|
||||
DHCP_CPE_ID_VENDOR = isc
|
||||
|
||||
# use libtool-enabled configure.ac
|
||||
@@ -22,6 +22,8 @@ DHCP_CONF_ENV = \
|
||||
-D_PATH_DHCLIENT_CONF=\"/etc/dhcp/dhclient.conf\"' \
|
||||
CFLAGS='$(TARGET_CFLAGS) -DISC_CHECK_NONE=1'
|
||||
|
||||
DHCP_CONF_ENV += ac_cv_prog_AWK=$(HOST_DIR)/bin/gawk
|
||||
|
||||
DHCP_CONF_OPTS = \
|
||||
--with-libbind=$(STAGING_DIR)/usr \
|
||||
--with-randomdev=/dev/random \
|
||||
|
||||
@@ -13,10 +13,12 @@ DMALLOC_LICENSE = MIT-like
|
||||
DMALLOC_LICENSE_FILES = dmalloc.h.1
|
||||
|
||||
DMALLOC_INSTALL_STAGING = YES
|
||||
DMALLOC_CONF_OPTS = --enable-shlib
|
||||
DMALLOC_CFLAGS = $(TARGET_CFLAGS)
|
||||
|
||||
ifeq ($(BR2_STATIC_LIBS),)
|
||||
ifeq ($(BR2_STATIC_LIBS),y)
|
||||
DMALLOC_CONF_OPTS += --disable-shlib
|
||||
else
|
||||
DMALLOC_CONF_OPTS += --enable-shlib
|
||||
DMALLOC_CFLAGS += -fPIC
|
||||
endif
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
From 7b9c2905883df5171fda10a364a81b8c6176c8e2 Mon Sep 17 00:00:00 2001
|
||||
From: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
|
||||
Date: Mon, 26 Apr 2021 15:28:40 +0900
|
||||
Subject: [PATCH] fix port forwarding with ipv6.disable=1
|
||||
|
||||
Make `docker run -p 80:80` functional again on environments with kernel boot parameter `ipv6.disable=1`.
|
||||
|
||||
Fix moby/moby issue 42288
|
||||
|
||||
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
|
||||
[Upstream: https://github.com/moby/libnetwork/pull/2635,
|
||||
https://github.com/moby/moby/pull/42322]
|
||||
[Rework path/drop test for docker-engine]
|
||||
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
||||
---
|
||||
vendor/github.com/docker/libnetwork/drivers/bridge/port_mapping.go | 31 +++++++++++++++++++++++++++++++
|
||||
1 file changed, 35 insertions(+), 0 deletion(-)
|
||||
|
||||
diff --git a/vendor/github.com/docker/libnetwork/drivers/bridge/port_mapping.go b/vendor/github.com/docker/libnetwork/drivers/bridge/port_mapping.go
|
||||
index 946130ec..17bf36f9 100644
|
||||
--- a/vendor/github.com/docker/libnetwork/drivers/bridge/port_mapping.go
|
||||
+++ b/vendor/github.com/docker/libnetwork/drivers/bridge/port_mapping.go
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
+ "sync"
|
||||
|
||||
"github.com/docker/libnetwork/types"
|
||||
"github.com/ishidawataru/sctp"
|
||||
@@ -50,6 +51,13 @@ func (n *bridgeNetwork) allocatePortsInternal(bindings []types.PortBinding, cont
|
||||
bs = append(bs, bIPv4)
|
||||
}
|
||||
|
||||
+ // skip adding implicit v6 addr, when the kernel was booted with `ipv6.disable=1`
|
||||
+ // https://github.com/moby/moby/issues/42288
|
||||
+ isV6Binding := c.HostIP != nil && c.HostIP.To4() == nil
|
||||
+ if !isV6Binding && !IsV6Listenable() {
|
||||
+ continue
|
||||
+ }
|
||||
+
|
||||
// Allocate IPv6 Port mappings
|
||||
// If the container has no IPv6 address, allow proxying host IPv6 traffic to it
|
||||
// by setting up the binding with the IPv4 interface if the userland proxy is enabled
|
||||
@@ -211,3 +219,26 @@ func (n *bridgeNetwork) releasePort(bnd types.PortBinding) error {
|
||||
|
||||
return portmapper.Unmap(host)
|
||||
}
|
||||
+
|
||||
+var (
|
||||
+ v6ListenableCached bool
|
||||
+ v6ListenableOnce sync.Once
|
||||
+)
|
||||
+
|
||||
+// IsV6Listenable returns true when `[::1]:0` is listenable.
|
||||
+// IsV6Listenable returns false mostly when the kernel was booted with `ipv6.disable=1` option.
|
||||
+func IsV6Listenable() bool {
|
||||
+ v6ListenableOnce.Do(func() {
|
||||
+ ln, err := net.Listen("tcp6", "[::1]:0")
|
||||
+ if err != nil {
|
||||
+ // When the kernel was booted with `ipv6.disable=1`,
|
||||
+ // we get err "listen tcp6 [::1]:0: socket: address family not supported by protocol"
|
||||
+ // https://github.com/moby/moby/issues/42288
|
||||
+ logrus.Debugf("port_mapping: v6Listenable=false (%v)", err)
|
||||
+ } else {
|
||||
+ v6ListenableCached = true
|
||||
+ ln.Close()
|
||||
+ }
|
||||
+ })
|
||||
+ return v6ListenableCached
|
||||
+}
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -34,9 +34,7 @@ config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_DEVICEMAPPER
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS # lvm2
|
||||
depends on BR2_USE_MMU # lvm2
|
||||
depends on !BR2_STATIC_LIBS # lvm2
|
||||
depends on !BR2_TOOLCHAIN_USES_MUSL # lvm2
|
||||
select BR2_PACKAGE_LVM2
|
||||
select BR2_PACKAGE_LVM2_APP_LIBRARY
|
||||
help
|
||||
Build the devicemapper filesystem driver for Docker.
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
From 7297a8ef3cab3b0faf1426622ee902a2144e2e89 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
Date: Wed, 24 Mar 2021 11:27:14 +0100
|
||||
Subject: [PATCH] ebtables.h: restore KERNEL_64_USERSPACE_32 checks
|
||||
|
||||
Commit e6359eedfbf497e52d52451072aea4713ed80a88 replaced the file ebtables.h
|
||||
but removed the usage of KERNEL_64_USERSPACE_32. This breaks boards where
|
||||
such flag is relevant, with following messages:
|
||||
|
||||
[ 6364.971346] kernel msg: ebtables bug: please report to author: Standard target size too big
|
||||
|
||||
Unable to update the kernel. Two possible causes:
|
||||
1. Multiple ebtables programs were executing simultaneously. The ebtables
|
||||
userspace tool doesn't by default support multiple ebtables programs running
|
||||
concurrently. The ebtables option --concurrent or a tool like flock can be
|
||||
used to support concurrent scripts that update the ebtables kernel tables.
|
||||
2. The kernel doesn't support a certain ebtables extension, consider
|
||||
recompiling your kernel or insmod the extension.
|
||||
|
||||
Analysis shows that the structure 'ebt_replace' passed from userspace
|
||||
ebtables to the kernel, is too small, i.e 80 bytes instead of 120 in case of
|
||||
64-bit kernel.
|
||||
|
||||
Note that the ebtables build system seems to assume that 'sparc64' is the
|
||||
only case where KERNEL_64_USERSPACE_32 is relevant, but this is not true.
|
||||
This situation can happen on many architectures, especially in embedded
|
||||
systems. For example, an Aarch64 processor with kernel in 64-bit but
|
||||
userland build for 32-bit Arm. Or a 64-bit MIPS Octeon III processor, with
|
||||
userland running in the 'n32' ABI.
|
||||
|
||||
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
Upstream-Status: http://patchwork.ozlabs.org/project/netfilter-devel/patch/20210518181730.13436-1-patrickdepinguin@gmail.com/
|
||||
---
|
||||
include/linux/netfilter_bridge/ebtables.h | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
|
||||
index 5be75f2..3c2b61e 100644
|
||||
--- a/include/linux/netfilter_bridge/ebtables.h
|
||||
+++ b/include/linux/netfilter_bridge/ebtables.h
|
||||
@@ -49,12 +49,21 @@ struct ebt_replace {
|
||||
/* total size of the entries */
|
||||
unsigned int entries_size;
|
||||
/* start of the chains */
|
||||
+#ifdef KERNEL_64_USERSPACE_32
|
||||
+ uint64_t hook_entry[NF_BR_NUMHOOKS];
|
||||
+#else
|
||||
struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
|
||||
+#endif
|
||||
/* nr of counters userspace expects back */
|
||||
unsigned int num_counters;
|
||||
/* where the kernel will put the old counters */
|
||||
+#ifdef KERNEL_64_USERSPACE_32
|
||||
+ uint64_t counters;
|
||||
+ uint64_t entries;
|
||||
+#else
|
||||
struct ebt_counter *counters;
|
||||
char *entries;
|
||||
+#endif
|
||||
};
|
||||
|
||||
struct ebt_replace_kernel {
|
||||
@@ -129,6 +138,9 @@ struct ebt_entry_match {
|
||||
} u;
|
||||
/* size of data */
|
||||
unsigned int match_size;
|
||||
+#ifdef KERNEL_64_USERSPACE_32
|
||||
+ unsigned int pad;
|
||||
+#endif
|
||||
unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
|
||||
};
|
||||
|
||||
@@ -142,6 +154,9 @@ struct ebt_entry_watcher {
|
||||
} u;
|
||||
/* size of data */
|
||||
unsigned int watcher_size;
|
||||
+#ifdef KERNEL_64_USERSPACE_32
|
||||
+ unsigned int pad;
|
||||
+#endif
|
||||
unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
|
||||
};
|
||||
|
||||
@@ -155,6 +170,9 @@ struct ebt_entry_target {
|
||||
} u;
|
||||
/* size of data */
|
||||
unsigned int target_size;
|
||||
+#ifdef KERNEL_64_USERSPACE_32
|
||||
+ unsigned int pad;
|
||||
+#endif
|
||||
unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
|
||||
};
|
||||
|
||||
@@ -162,6 +180,9 @@ struct ebt_entry_target {
|
||||
struct ebt_standard_target {
|
||||
struct ebt_entry_target target;
|
||||
int verdict;
|
||||
+#ifdef KERNEL_64_USERSPACE_32
|
||||
+ unsigned int pad;
|
||||
+#endif
|
||||
};
|
||||
|
||||
/* one entry */
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
From ebf0236270b977a62c522bc32810bc9f8edc72d1 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
Date: Wed, 24 Mar 2021 13:40:14 +0100
|
||||
Subject: [PATCH] configure.ac: add option --enable-kernel-64-userland-32
|
||||
|
||||
The ebtables build system seems to assume that 'sparc64' is the
|
||||
only case where KERNEL_64_USERSPACE_32 is relevant, but this is not true.
|
||||
This situation can happen on many architectures, especially in embedded
|
||||
systems. For example, an Aarch64 processor with kernel in 64-bit but
|
||||
userland build for 32-bit Arm. Or a 64-bit MIPS Octeon III processor, with
|
||||
userland running in the 'n32' ABI.
|
||||
|
||||
While it is possible to set CFLAGS in the environment when calling the
|
||||
configure script, the caller would need to know to not only specify
|
||||
KERNEL_64_USERSPACE_32 but also the EBT_MIN_ALIGN value.
|
||||
|
||||
Instead, add a configure option. All internal details can then be handled by
|
||||
the configure script.
|
||||
|
||||
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
|
||||
Upstream-Status: http://patchwork.ozlabs.org/project/netfilter-devel/patch/20210518181730.13436-2-patrickdepinguin@gmail.com/
|
||||
---
|
||||
configure.ac | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index c24ede3..3e89c0c 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -15,10 +15,17 @@ AS_IF([test "x$LOCKFILE" = x], [LOCKFILE="/var/lib/ebtables/lock"])
|
||||
|
||||
regular_CFLAGS="-Wall -Wunused"
|
||||
regular_CPPFLAGS=""
|
||||
+
|
||||
case "$host" in
|
||||
sparc64-*)
|
||||
- regular_CPPFLAGS="$regular_CPPFLAGS -DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32";;
|
||||
+ enable_kernel_64_userland_32=yes ;;
|
||||
esac
|
||||
+AC_ARG_ENABLE([kernel-64-userland-32],
|
||||
+ AC_HELP_STRING([--enable-kernel-64-userland-32], [indicate that ebtables will be built as a 32-bit application but run under a 64-bit kernel])
|
||||
+)
|
||||
+AS_IF([test "x$enable_kernel_64_userland_32" = xyes],
|
||||
+ [regular_CPPFLAGS="$regular_CPPFLAGS -DEBT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32"]
|
||||
+)
|
||||
|
||||
AC_SUBST([regular_CFLAGS])
|
||||
AC_SUBST([regular_CPPFLAGS])
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -11,6 +11,12 @@ EBTABLES_LICENSE_FILES = COPYING
|
||||
EBTABLES_CPE_ID_VENDOR = netfilter
|
||||
EBTABLES_SELINUX_MODULES = iptables
|
||||
|
||||
# for 0003-configure.ac-add-option-enable-kernel-64-userland-32.patch
|
||||
EBTABLES_AUTORECONF = YES
|
||||
ifeq ($(BR2_KERNEL_64_USERLAND_32),y)
|
||||
EBTABLES_CONF_OPTS += --enable-kernel-64-userland-32
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_EBTABLES_UTILS_SAVE),y)
|
||||
define EBTABLES_INSTALL_TARGET_UTILS_SAVE
|
||||
$(INSTALL) -m 0755 -D $(@D)/ebtables-save.sh $(TARGET_DIR)/usr/sbin/ebtables-legacy-save
|
||||
|
||||
@@ -258,6 +258,7 @@ config BR2_PACKAGE_EFL_WEBP
|
||||
|
||||
config BR2_PACKAGE_EFL_LIBRAW
|
||||
bool "libraw loader"
|
||||
depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libraw
|
||||
select BR2_PACKAGE_LIBRAW
|
||||
help
|
||||
This option enables the Evas generic Libraw loader
|
||||
|
||||
@@ -10,6 +10,7 @@ ENLIGHTENMENT_SITE = http://download.enlightenment.org/rel/apps/enlightenment
|
||||
ENLIGHTENMENT_LICENSE = BSD-2-Clause, OFL-1.1 (font)
|
||||
ENLIGHTENMENT_LICENSE_FILES = COPYING \
|
||||
src/modules/wl_weekeyboard/themes/default/fonts/LICENSE.txt
|
||||
ENLIGHTENMENT_CPE_ID_VENDOR = enlightenment
|
||||
|
||||
ENLIGHTENMENT_DEPENDENCIES = \
|
||||
host-pkgconf \
|
||||
|
||||
@@ -8,6 +8,7 @@ ENSCRIPT_VERSION = 1.6.6
|
||||
ENSCRIPT_SITE = $(BR2_GNU_MIRROR)/enscript
|
||||
ENSCRIPT_LICENSE = GPL-3.0+
|
||||
ENSCRIPT_LICENSE_FILES = COPYING
|
||||
ENSCRIPT_CPE_ID_VENDOR = gnu
|
||||
|
||||
# Enable pthread threads if toolchain supports threads
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
|
||||
|
||||
@@ -26,8 +26,8 @@ define HOST_ENVIRONMENT_SETUP_INSTALL_CMDS
|
||||
printf "alias cmake=\"cmake \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$(HOST_DIR)/share/buildroot/toolchainfile.cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr\"\n" >> $(ENVIRONMENT_SETUP_FILE)
|
||||
$(SED) 's%$(HOST_DIR)%\$$SDK_PATH%g' \
|
||||
-e 's%$(HOST_DIR)/bin/%%g' \
|
||||
$(SED) 's%$(HOST_DIR)/bin/%%g' \
|
||||
-e 's%$(HOST_DIR)%\$$SDK_PATH%g' \
|
||||
-e '/^export "PATH=/c\' \
|
||||
$(ENVIRONMENT_SETUP_FILE)
|
||||
printf "export \"PATH=\$$SDK_PATH/bin:\$$SDK_PATH/sbin:\$$PATH\"\n" \
|
||||
|
||||
@@ -13,5 +13,6 @@ EXEMPI_DEPENDENCIES = host-pkgconf expat zlib \
|
||||
$(if $(BR2_PACKAGE_LIBICONV),libiconv)
|
||||
EXEMPI_LICENSE = BSD-3-Clause
|
||||
EXEMPI_LICENSE_FILES = COPYING
|
||||
EXEMPI_CPE_ID_VENDOR = exempi_project
|
||||
|
||||
$(eval $(autotools-package))
|
||||
|
||||
@@ -10,6 +10,8 @@ FLATCC_LICENSE = Apache-2.0
|
||||
FLATCC_LICENSE_FILES = LICENSE
|
||||
FLATCC_INSTALL_STAGING = YES
|
||||
FLATCC_DEPENDENCIES = host-flatcc
|
||||
FLATCC_CONF_OPTS = -DFLATCC_ALLOW_WERROR=OFF
|
||||
HOST_FLATCC_CONF_OPTS = -DFLATCC_ALLOW_WERROR=OFF
|
||||
|
||||
# Disable build of tests and samples
|
||||
FLATCC_CONF_OPTS += -DFLATCC_TEST=OFF
|
||||
|
||||
@@ -8,6 +8,7 @@ FLUIDSYNTH_VERSION = 2.2.0
|
||||
FLUIDSYNTH_SITE = $(call github,FluidSynth,fluidsynth,v$(FLUIDSYNTH_VERSION))
|
||||
FLUIDSYNTH_LICENSE = LGPL-2.1+
|
||||
FLUIDSYNTH_LICENSE_FILES = LICENSE
|
||||
FLUIDSYNTH_CPE_ID_VENDOR = fluidsynth
|
||||
FLUIDSYNTH_INSTALL_STAGING = YES
|
||||
FLUIDSYNTH_DEPENDENCIES = libglib2
|
||||
|
||||
|
||||
@@ -84,11 +84,16 @@ config BR2_PACKAGE_PROVIDES_LIBOPENVG
|
||||
|
||||
config BR2_PACKAGE_IMX_GPU_VIV_EXAMPLES
|
||||
bool "install examples"
|
||||
# example binaries are linked against libstdc++.so.6
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
help
|
||||
Copy the Vivante examples to the target.
|
||||
|
||||
Warning: examples take approximately 150 MB of disk space.
|
||||
|
||||
comment "imx-gpu-viv-examples need a toolchain w/ C++ support"
|
||||
depends on !BR2_INSTALL_LIBSTDCPP
|
||||
|
||||
config BR2_PACKAGE_IMX_GPU_VIV_GMEM_INFO
|
||||
bool "install gmem_info tool"
|
||||
help
|
||||
|
||||
@@ -8,6 +8,8 @@ FRR_VERSION = 7.5.1
|
||||
FRR_SITE = $(call github,FRRouting,frr,frr-$(FRR_VERSION))
|
||||
FRR_LICENSE = GPL-2.0
|
||||
FRR_LICENSE_FILES = COPYING
|
||||
FRR_CPE_ID_VENDOR = linuxfoundation
|
||||
FRR_CPE_ID_PRODUCT = free_range_routing
|
||||
FRR_AUTORECONF = YES
|
||||
|
||||
FRR_DEPENDENCIES = host-frr readline json-c \
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
From 1dad3f95ffcd1871ca670a13a06fbedb1c3ce509 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:11:44 +0900
|
||||
Subject: [PATCH] or1k: Add mcmodel option to handle large GOTs
|
||||
|
||||
When building libgeos we get an error with:
|
||||
|
||||
linux-uclibc/9.3.0/crtbeginS.o: in function `__do_global_dtors_aux':
|
||||
crtstuff.c:(.text+0x118): relocation truncated to fit: R_OR1K_GOT16 against symbol `__cxa_finalize' defined in .text section in
|
||||
/home/shorne/work/openrisc/3eb9f9d0f6d8274b2d19753c006bd83f7d536e3c/output/host/or1k-buildroot-linux-uclibc/sysroot/lib/libc.so.
|
||||
|
||||
This is caused by GOT code having a limit of 64k. In OpenRISC this
|
||||
looks to be the only relocation code pattern to be limited to 64k.
|
||||
|
||||
This patch allows specifying a new option -mcmodel=large which can be
|
||||
used to generate 2 more instructions to construct 32-bit addresses for
|
||||
up to 4G GOTs.
|
||||
|
||||
gcc/ChangeLog:
|
||||
|
||||
PR 99783
|
||||
* config/or1k/or1k-opts.h: New file.
|
||||
* config/or1k/or1k.c (or1k_legitimize_address_1, print_reloc):
|
||||
Support generating gotha relocations if -mcmodel=large is
|
||||
specified.
|
||||
* config/or1k/or1k.h (TARGET_CMODEL_SMALL, TARGET_CMODEL_LARGE):
|
||||
New macros.
|
||||
* config/or1k/or1k.opt (mcmodel=): New option.
|
||||
* doc/invoke.text (OpenRISC Options): Document mcmodel.
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
gcc/config/or1k/or1k-opts.h | 30 ++++++++++++++++++++++++++++++
|
||||
gcc/config/or1k/or1k.c | 11 +++++++++--
|
||||
gcc/config/or1k/or1k.h | 7 +++++++
|
||||
gcc/config/or1k/or1k.opt | 19 +++++++++++++++++++
|
||||
gcc/doc/invoke.texi | 12 +++++++++++-
|
||||
5 files changed, 76 insertions(+), 3 deletions(-)
|
||||
create mode 100644 gcc/config/or1k/or1k-opts.h
|
||||
|
||||
diff --git a/gcc/config/or1k/or1k-opts.h b/gcc/config/or1k/or1k-opts.h
|
||||
new file mode 100644
|
||||
index 00000000000..f791b894fdd
|
||||
--- /dev/null
|
||||
+++ b/gcc/config/or1k/or1k-opts.h
|
||||
@@ -0,0 +1,30 @@
|
||||
+/* Definitions for option handling for OpenRISC.
|
||||
+ Copyright (C) 2021 Free Software Foundation, Inc.
|
||||
+ Contributed by Stafford Horne.
|
||||
+
|
||||
+ This file is part of GCC.
|
||||
+
|
||||
+ GCC is free software; you can redistribute it and/or modify it
|
||||
+ under the terms of the GNU General Public License as published
|
||||
+ by the Free Software Foundation; either version 3, or (at your
|
||||
+ option) any later version.
|
||||
+
|
||||
+ GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
+ License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with GCC; see the file COPYING3. If not see
|
||||
+ <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+#ifndef GCC_OR1K_OPTS_H
|
||||
+#define GCC_OR1K_OPTS_H
|
||||
+
|
||||
+/* The OpenRISC code generation models available. */
|
||||
+enum or1k_cmodel_type {
|
||||
+ CMODEL_SMALL,
|
||||
+ CMODEL_LARGE
|
||||
+};
|
||||
+
|
||||
+#endif /* GCC_OR1K_OPTS_H */
|
||||
diff --git a/gcc/config/or1k/or1k.c b/gcc/config/or1k/or1k.c
|
||||
index 5fa5425aa2b..88613f9596b 100644
|
||||
--- a/gcc/config/or1k/or1k.c
|
||||
+++ b/gcc/config/or1k/or1k.c
|
||||
@@ -750,7 +750,14 @@ or1k_legitimize_address_1 (rtx x, rtx scratch)
|
||||
{
|
||||
base = gen_sym_unspec (base, UNSPEC_GOT);
|
||||
crtl->uses_pic_offset_table = 1;
|
||||
- t2 = gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, base);
|
||||
+ if (TARGET_CMODEL_LARGE)
|
||||
+ {
|
||||
+ emit_insn (gen_rtx_SET (t1, gen_rtx_HIGH (Pmode, base)));
|
||||
+ emit_insn (gen_add3_insn (t1, t1, pic_offset_table_rtx));
|
||||
+ t2 = gen_rtx_LO_SUM (Pmode, t1, base);
|
||||
+ }
|
||||
+ else
|
||||
+ t2 = gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, base);
|
||||
t2 = gen_const_mem (Pmode, t2);
|
||||
emit_insn (gen_rtx_SET (t1, t2));
|
||||
base = t1;
|
||||
@@ -1089,7 +1096,7 @@ print_reloc (FILE *stream, rtx x, HOST_WIDE_INT add, reloc_kind kind)
|
||||
no special markup. */
|
||||
static const char * const relocs[RKIND_MAX][RTYPE_MAX] = {
|
||||
{ "lo", "got", "gotofflo", "tpofflo", "gottpofflo", "tlsgdlo" },
|
||||
- { "ha", NULL, "gotoffha", "tpoffha", "gottpoffha", "tlsgdhi" },
|
||||
+ { "ha", "gotha", "gotoffha", "tpoffha", "gottpoffha", "tlsgdhi" },
|
||||
};
|
||||
reloc_type type = RTYPE_DIRECT;
|
||||
|
||||
diff --git a/gcc/config/or1k/or1k.h b/gcc/config/or1k/or1k.h
|
||||
index 23db771d8fb..f1646d16dfd 100644
|
||||
--- a/gcc/config/or1k/or1k.h
|
||||
+++ b/gcc/config/or1k/or1k.h
|
||||
@@ -21,6 +21,8 @@
|
||||
#ifndef GCC_OR1K_H
|
||||
#define GCC_OR1K_H
|
||||
|
||||
+#include "config/or1k/or1k-opts.h"
|
||||
+
|
||||
/* Names to predefine in the preprocessor for this target machine. */
|
||||
#define TARGET_CPU_CPP_BUILTINS() \
|
||||
do \
|
||||
@@ -35,6 +37,11 @@
|
||||
} \
|
||||
while (0)
|
||||
|
||||
+#define TARGET_CMODEL_SMALL \
|
||||
+ (or1k_code_model == CMODEL_SMALL)
|
||||
+#define TARGET_CMODEL_LARGE \
|
||||
+ (or1k_code_model == CMODEL_LARGE)
|
||||
+
|
||||
/* Storage layout. */
|
||||
|
||||
#define DEFAULT_SIGNED_CHAR 1
|
||||
diff --git a/gcc/config/or1k/or1k.opt b/gcc/config/or1k/or1k.opt
|
||||
index 03c9b8d0bba..8e035075f8a 100644
|
||||
--- a/gcc/config/or1k/or1k.opt
|
||||
+++ b/gcc/config/or1k/or1k.opt
|
||||
@@ -21,6 +21,9 @@
|
||||
; See the GCC internals manual (options.texi) for a description of
|
||||
; this file's format.
|
||||
|
||||
+HeaderInclude
|
||||
+config/or1k/or1k-opts.h
|
||||
+
|
||||
mhard-div
|
||||
Target RejectNegative InverseMask(SOFT_DIV)
|
||||
Enable generation of hardware divide (l.div, l.divu) instructions. This is the
|
||||
@@ -63,6 +66,22 @@ When -mhard-float is selected, enables generation of unordered floating point
|
||||
compare and set flag (lf.sfun*) instructions. By default functions from libgcc
|
||||
are used to perform unordered floating point compare and set flag operations.
|
||||
|
||||
+mcmodel=
|
||||
+Target RejectNegative Joined Enum(or1k_cmodel_type) Var(or1k_code_model) Init(CMODEL_SMALL)
|
||||
+Specify the code model used for accessing memory addresses. Specifying large
|
||||
+enables generating binaries with large global offset tables. By default the
|
||||
+value is small.
|
||||
+
|
||||
+Enum
|
||||
+Name(or1k_cmodel_type) Type(enum or1k_cmodel_type)
|
||||
+Known code model types (for use with the -mcmodel= option):
|
||||
+
|
||||
+EnumValue
|
||||
+Enum(or1k_cmodel_type) String(small) Value(CMODEL_SMALL)
|
||||
+
|
||||
+EnumValue
|
||||
+Enum(or1k_cmodel_type) String(large) Value(CMODEL_LARGE)
|
||||
+
|
||||
mcmov
|
||||
Target RejectNegative Mask(CMOV)
|
||||
Enable generation of conditional move (l.cmov) instructions. By default the
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index eabeec944e7..eda350c99ec 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -1102,7 +1102,8 @@ Objective-C and Objective-C++ Dialects}.
|
||||
@gccoptlist{-mboard=@var{name} -mnewlib -mhard-mul -mhard-div @gol
|
||||
-msoft-mul -msoft-div @gol
|
||||
-msoft-float -mhard-float -mdouble-float -munordered-float @gol
|
||||
--mcmov -mror -mrori -msext -msfimm -mshftimm}
|
||||
+-mcmov -mror -mrori -msext -msfimm -mshftimm @gol
|
||||
+-mcmodel=@var{code-model}}
|
||||
|
||||
@emph{PDP-11 Options}
|
||||
@gccoptlist{-mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10 @gol
|
||||
@@ -25111,6 +25112,15 @@ Enable generation of shift with immediate (@code{l.srai}, @code{l.srli},
|
||||
@code{l.slli}) instructions. By default extra instructions will be generated
|
||||
to store the immediate to a register first.
|
||||
|
||||
+@item -mcmodel=small
|
||||
+@opindex mcmodel=small
|
||||
+Generate OpenRISC code for the small model: The GOT is limited to 64k. This is
|
||||
+the default model.
|
||||
+
|
||||
+@item -mcmodel=large
|
||||
+@opindex mcmodel=large
|
||||
+Generate OpenRISC code for the large model: The GOT may grow up to 4G in size.
|
||||
+
|
||||
|
||||
@end table
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
From 0354e007a6235df81e208fa89cbf1571a8b56975 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:11:45 +0900
|
||||
Subject: [PATCH] or1k: Use cmodel=large when building crtstuff
|
||||
|
||||
When linking gcc runtime objects into large binaries the link may fail
|
||||
with the below errors. This will happen even if we are building with
|
||||
-mcmodel=large.
|
||||
|
||||
/home/shorne/work/openrisc/output/host/lib/gcc/or1k-buildroot-linux-uclibc/10.3.0/crtbeginS.o: in function `deregister_tm_clones':
|
||||
crtstuff.c:(.text+0x3c): relocation truncated to fit: R_OR1K_GOT16 against undefined symbol `_ITM_deregisterTMCloneTable'
|
||||
/home/shorne/work/openrisc/output/host/lib/gcc/or1k-buildroot-linux-uclibc/10.3.0/crtbeginS.o: in function `register_tm_clones':
|
||||
crtstuff.c:(.text+0xc0): relocation truncated to fit: R_OR1K_GOT16 against undefined symbol `_ITM_registerTMCloneTable'
|
||||
|
||||
This patch builds the gcc crtstuff binaries always with the
|
||||
-mcmodel=large option to ensure they can be linked into large binaries.
|
||||
|
||||
libgcc/ChangeLog:
|
||||
|
||||
PR 99783
|
||||
* config.host (or1k-*, tmake_file): Add or1k/t-crtstuff.
|
||||
* config/or1k/t-crtstuff: New file.
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
libgcc/config.host | 4 ++--
|
||||
libgcc/config/or1k/t-crtstuff | 2 ++
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
create mode 100644 libgcc/config/or1k/t-crtstuff
|
||||
|
||||
diff --git a/libgcc/config.host b/libgcc/config.host
|
||||
index c529cc40f0c..ddf0033e28c 100644
|
||||
--- a/libgcc/config.host
|
||||
+++ b/libgcc/config.host
|
||||
@@ -1127,12 +1127,12 @@ nios2-*-*)
|
||||
extra_parts="$extra_parts crti.o crtn.o"
|
||||
;;
|
||||
or1k-*-linux*)
|
||||
- tmake_file="$tmake_file or1k/t-or1k"
|
||||
+ tmake_file="$tmake_file or1k/t-or1k or1k/t-crtstuff"
|
||||
tmake_file="$tmake_file t-softfp-sfdf t-softfp"
|
||||
md_unwind_header=or1k/linux-unwind.h
|
||||
;;
|
||||
or1k-*-*)
|
||||
- tmake_file="$tmake_file or1k/t-or1k"
|
||||
+ tmake_file="$tmake_file or1k/t-or1k or1k/t-crtstuff"
|
||||
tmake_file="$tmake_file t-softfp-sfdf t-softfp"
|
||||
;;
|
||||
pdp11-*-*)
|
||||
diff --git a/libgcc/config/or1k/t-crtstuff b/libgcc/config/or1k/t-crtstuff
|
||||
new file mode 100644
|
||||
index 00000000000..dcae7f3498e
|
||||
--- /dev/null
|
||||
+++ b/libgcc/config/or1k/t-crtstuff
|
||||
@@ -0,0 +1,2 @@
|
||||
+# Compile crtbeginS.o and crtendS.o with -mcmodel=large
|
||||
+CRTSTUFF_T_CFLAGS_S += -mcmodel=large
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
From 1af3ab7fc3e4f2ae835c976486e8af0762674af3 Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:11:44 +0900
|
||||
Subject: [PATCH] or1k: Add mcmodel option to handle large GOTs
|
||||
|
||||
When building libgeos we get an error with:
|
||||
|
||||
linux-uclibc/9.3.0/crtbeginS.o: in function `__do_global_dtors_aux':
|
||||
crtstuff.c:(.text+0x118): relocation truncated to fit: R_OR1K_GOT16 against symbol `__cxa_finalize' defined in .text section in
|
||||
/home/shorne/work/openrisc/3eb9f9d0f6d8274b2d19753c006bd83f7d536e3c/output/host/or1k-buildroot-linux-uclibc/sysroot/lib/libc.so.
|
||||
|
||||
This is caused by GOT code having a limit of 64k. In OpenRISC this
|
||||
looks to be the only relocation code pattern to be limited to 64k.
|
||||
|
||||
This patch allows specifying a new option -mcmodel=large which can be
|
||||
used to generate 2 more instructions to construct 32-bit addresses for
|
||||
up to 4G GOTs.
|
||||
|
||||
gcc/ChangeLog:
|
||||
|
||||
PR 99783
|
||||
* config/or1k/or1k-opts.h: New file.
|
||||
* config/or1k/or1k.c (or1k_legitimize_address_1, print_reloc):
|
||||
Support generating gotha relocations if -mcmodel=large is
|
||||
specified.
|
||||
* config/or1k/or1k.h (TARGET_CMODEL_SMALL, TARGET_CMODEL_LARGE):
|
||||
New macros.
|
||||
* config/or1k/or1k.opt (mcmodel=): New option.
|
||||
* doc/invoke.text (OpenRISC Options): Document mcmodel.
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
gcc/config/or1k/or1k-opts.h | 30 ++++++++++++++++++++++++++++++
|
||||
gcc/config/or1k/or1k.c | 11 +++++++++--
|
||||
gcc/config/or1k/or1k.h | 7 +++++++
|
||||
gcc/config/or1k/or1k.opt | 19 +++++++++++++++++++
|
||||
gcc/doc/invoke.texi | 13 ++++++++++++-
|
||||
5 files changed, 77 insertions(+), 3 deletions(-)
|
||||
create mode 100644 gcc/config/or1k/or1k-opts.h
|
||||
|
||||
diff --git a/gcc/config/or1k/or1k-opts.h b/gcc/config/or1k/or1k-opts.h
|
||||
new file mode 100644
|
||||
index 00000000000..f791b894fdd
|
||||
--- /dev/null
|
||||
+++ b/gcc/config/or1k/or1k-opts.h
|
||||
@@ -0,0 +1,30 @@
|
||||
+/* Definitions for option handling for OpenRISC.
|
||||
+ Copyright (C) 2021 Free Software Foundation, Inc.
|
||||
+ Contributed by Stafford Horne.
|
||||
+
|
||||
+ This file is part of GCC.
|
||||
+
|
||||
+ GCC is free software; you can redistribute it and/or modify it
|
||||
+ under the terms of the GNU General Public License as published
|
||||
+ by the Free Software Foundation; either version 3, or (at your
|
||||
+ option) any later version.
|
||||
+
|
||||
+ GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
+ License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with GCC; see the file COPYING3. If not see
|
||||
+ <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+#ifndef GCC_OR1K_OPTS_H
|
||||
+#define GCC_OR1K_OPTS_H
|
||||
+
|
||||
+/* The OpenRISC code generation models available. */
|
||||
+enum or1k_cmodel_type {
|
||||
+ CMODEL_SMALL,
|
||||
+ CMODEL_LARGE
|
||||
+};
|
||||
+
|
||||
+#endif /* GCC_OR1K_OPTS_H */
|
||||
diff --git a/gcc/config/or1k/or1k.c b/gcc/config/or1k/or1k.c
|
||||
index fc10fcfabde..df67d72b139 100644
|
||||
--- a/gcc/config/or1k/or1k.c
|
||||
+++ b/gcc/config/or1k/or1k.c
|
||||
@@ -750,7 +750,14 @@ or1k_legitimize_address_1 (rtx x, rtx scratch)
|
||||
{
|
||||
base = gen_sym_unspec (base, UNSPEC_GOT);
|
||||
crtl->uses_pic_offset_table = 1;
|
||||
- t2 = gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, base);
|
||||
+ if (TARGET_CMODEL_LARGE)
|
||||
+ {
|
||||
+ emit_insn (gen_rtx_SET (t1, gen_rtx_HIGH (Pmode, base)));
|
||||
+ emit_insn (gen_add3_insn (t1, t1, pic_offset_table_rtx));
|
||||
+ t2 = gen_rtx_LO_SUM (Pmode, t1, base);
|
||||
+ }
|
||||
+ else
|
||||
+ t2 = gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, base);
|
||||
t2 = gen_const_mem (Pmode, t2);
|
||||
emit_insn (gen_rtx_SET (t1, t2));
|
||||
base = t1;
|
||||
@@ -1097,7 +1104,7 @@ print_reloc (FILE *stream, rtx x, HOST_WIDE_INT add, reloc_kind kind)
|
||||
no special markup. */
|
||||
static const char * const relocs[RKIND_MAX][RTYPE_MAX] = {
|
||||
{ "lo", "got", "gotofflo", "tpofflo", "gottpofflo", "tlsgdlo" },
|
||||
- { "ha", NULL, "gotoffha", "tpoffha", "gottpoffha", "tlsgdhi" },
|
||||
+ { "ha", "gotha", "gotoffha", "tpoffha", "gottpoffha", "tlsgdhi" },
|
||||
};
|
||||
reloc_type type = RTYPE_DIRECT;
|
||||
|
||||
diff --git a/gcc/config/or1k/or1k.h b/gcc/config/or1k/or1k.h
|
||||
index 6dda230f217..858f30743b7 100644
|
||||
--- a/gcc/config/or1k/or1k.h
|
||||
+++ b/gcc/config/or1k/or1k.h
|
||||
@@ -21,6 +21,8 @@
|
||||
#ifndef GCC_OR1K_H
|
||||
#define GCC_OR1K_H
|
||||
|
||||
+#include "config/or1k/or1k-opts.h"
|
||||
+
|
||||
/* Names to predefine in the preprocessor for this target machine. */
|
||||
#define TARGET_CPU_CPP_BUILTINS() \
|
||||
do \
|
||||
@@ -35,6 +37,11 @@
|
||||
} \
|
||||
while (0)
|
||||
|
||||
+#define TARGET_CMODEL_SMALL \
|
||||
+ (or1k_code_model == CMODEL_SMALL)
|
||||
+#define TARGET_CMODEL_LARGE \
|
||||
+ (or1k_code_model == CMODEL_LARGE)
|
||||
+
|
||||
/* Storage layout. */
|
||||
|
||||
#define DEFAULT_SIGNED_CHAR 1
|
||||
diff --git a/gcc/config/or1k/or1k.opt b/gcc/config/or1k/or1k.opt
|
||||
index 7bdbd842dd4..116524c3441 100644
|
||||
--- a/gcc/config/or1k/or1k.opt
|
||||
+++ b/gcc/config/or1k/or1k.opt
|
||||
@@ -23,6 +23,9 @@
|
||||
|
||||
; Please try to keep this file in ASCII collating order.
|
||||
|
||||
+HeaderInclude
|
||||
+config/or1k/or1k-opts.h
|
||||
+
|
||||
mhard-div
|
||||
Target RejectNegative InverseMask(SOFT_DIV)
|
||||
Use hardware divide instructions, use -msoft-div for emulation.
|
||||
@@ -31,6 +34,22 @@ mhard-mul
|
||||
Target RejectNegative InverseMask(SOFT_MUL).
|
||||
Use hardware multiply instructions, use -msoft-mul for emulation.
|
||||
|
||||
+mcmodel=
|
||||
+Target RejectNegative Joined Enum(or1k_cmodel_type) Var(or1k_code_model) Init(CMODEL_SMALL)
|
||||
+Specify the code model used for accessing memory addresses. Specifying large
|
||||
+enables generating binaries with large global offset tables. By default the
|
||||
+value is small.
|
||||
+
|
||||
+Enum
|
||||
+Name(or1k_cmodel_type) Type(enum or1k_cmodel_type)
|
||||
+Known code model types (for use with the -mcmodel= option):
|
||||
+
|
||||
+EnumValue
|
||||
+Enum(or1k_cmodel_type) String(small) Value(CMODEL_SMALL)
|
||||
+
|
||||
+EnumValue
|
||||
+Enum(or1k_cmodel_type) String(large) Value(CMODEL_LARGE)
|
||||
+
|
||||
mcmov
|
||||
Target RejectNegative Mask(CMOV)
|
||||
Allows generation of binaries which use the l.cmov instruction. If your target
|
||||
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
||||
index 0ab6c9c6449..0904b2b5a41 100644
|
||||
--- a/gcc/doc/invoke.texi
|
||||
+++ b/gcc/doc/invoke.texi
|
||||
@@ -1030,7 +1030,9 @@ Objective-C and Objective-C++ Dialects}.
|
||||
@emph{OpenRISC Options}
|
||||
@gccoptlist{-mboard=@var{name} -mnewlib -mhard-mul -mhard-div @gol
|
||||
-msoft-mul -msoft-div @gol
|
||||
--mcmov -mror -msext -msfimm -mshftimm}
|
||||
+-mcmov -mror -mrori -msext -msfimm -mshftimm @gol
|
||||
+-mcmodel=@var{code-model}}
|
||||
+
|
||||
|
||||
@emph{PDP-11 Options}
|
||||
@gccoptlist{-mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10 @gol
|
||||
@@ -27408,6 +27410,15 @@ MWAITX, SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A,
|
||||
SSSE3, SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
|
||||
instruction set extensions.)
|
||||
|
||||
+@item -mcmodel=small
|
||||
+@opindex mcmodel=small
|
||||
+Generate OpenRISC code for the small model: The GOT is limited to 64k. This is
|
||||
+the default model.
|
||||
+
|
||||
+@item -mcmodel=large
|
||||
+@opindex mcmodel=large
|
||||
+Generate OpenRISC code for the large model: The GOT may grow up to 4G in size.
|
||||
+
|
||||
|
||||
@item btver1
|
||||
CPUs based on AMD Family 14h cores with x86-64 instruction set support. (This
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
From b540f7b916ba7cf2059b84c5cc8d08c67ebe9a0b Mon Sep 17 00:00:00 2001
|
||||
From: Stafford Horne <shorne@gmail.com>
|
||||
Date: Sun, 2 May 2021 06:11:45 +0900
|
||||
Subject: [PATCH] or1k: Use cmodel=large when building crtstuff
|
||||
|
||||
When linking gcc runtime objects into large binaries the link may fail
|
||||
with the below errors. This will happen even if we are building with
|
||||
-mcmodel=large.
|
||||
|
||||
/home/shorne/work/openrisc/output/host/lib/gcc/or1k-buildroot-linux-uclibc/10.3.0/crtbeginS.o: in function `deregister_tm_clones':
|
||||
crtstuff.c:(.text+0x3c): relocation truncated to fit: R_OR1K_GOT16 against undefined symbol `_ITM_deregisterTMCloneTable'
|
||||
/home/shorne/work/openrisc/output/host/lib/gcc/or1k-buildroot-linux-uclibc/10.3.0/crtbeginS.o: in function `register_tm_clones':
|
||||
crtstuff.c:(.text+0xc0): relocation truncated to fit: R_OR1K_GOT16 against undefined symbol `_ITM_registerTMCloneTable'
|
||||
|
||||
This patch builds the gcc crtstuff binaries always with the
|
||||
-mcmodel=large option to ensure they can be linked into large binaries.
|
||||
|
||||
libgcc/ChangeLog:
|
||||
|
||||
PR 99783
|
||||
* config.host (or1k-*, tmake_file): Add or1k/t-crtstuff.
|
||||
* config/or1k/t-crtstuff: New file.
|
||||
|
||||
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
|
||||
---
|
||||
libgcc/config.host | 4 ++--
|
||||
libgcc/config/or1k/t-crtstuff | 2 ++
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
create mode 100644 libgcc/config/or1k/t-crtstuff
|
||||
|
||||
diff --git a/libgcc/config.host b/libgcc/config.host
|
||||
index 0f15fda3612..0c21d384e6f 100644
|
||||
--- a/libgcc/config.host
|
||||
+++ b/libgcc/config.host
|
||||
@@ -1051,12 +1051,12 @@ nios2-*-*)
|
||||
extra_parts="$extra_parts crti.o crtn.o"
|
||||
;;
|
||||
or1k-*-linux*)
|
||||
- tmake_file="$tmake_file or1k/t-or1k"
|
||||
+ tmake_file="$tmake_file or1k/t-or1k or1k/t-crtstuff"
|
||||
tmake_file="$tmake_file t-softfp-sfdf t-softfp"
|
||||
md_unwind_header=or1k/linux-unwind.h
|
||||
;;
|
||||
or1k-*-*)
|
||||
- tmake_file="$tmake_file or1k/t-or1k"
|
||||
+ tmake_file="$tmake_file or1k/t-or1k or1k/t-crtstuff"
|
||||
tmake_file="$tmake_file t-softfp-sfdf t-softfp"
|
||||
;;
|
||||
pdp11-*-*)
|
||||
diff --git a/libgcc/config/or1k/t-crtstuff b/libgcc/config/or1k/t-crtstuff
|
||||
new file mode 100644
|
||||
index 00000000000..dcae7f3498e
|
||||
--- /dev/null
|
||||
+++ b/libgcc/config/or1k/t-crtstuff
|
||||
@@ -0,0 +1,2 @@
|
||||
+# Compile crtbeginS.o and crtendS.o with -mcmodel=large
|
||||
+CRTSTUFF_T_CFLAGS_S += -mcmodel=large
|
||||
--
|
||||
2.25.1
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ endif
|
||||
ifeq ($(BR2_PACKAGE_LIBICONV),y)
|
||||
GD_DEPENDENCIES += libiconv
|
||||
# not strictly needed for gd, but ensures -liconv ends up in gdlib.pc
|
||||
GD_CONF_ENV += LIBS="-liconv"
|
||||
GD_CONF_ENV += LIBS_PRIVATES="-liconv"
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_JPEG),y)
|
||||
|
||||
@@ -18,6 +18,10 @@ GERBERA_DEPENDENCIES = \
|
||||
zlib
|
||||
GERBERA_CONF_OPTS = -DWITH_DEBUG=OFF
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_9)$(BR2_OPTIMIZE_S),yy)
|
||||
GERBERA_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -O2"
|
||||
endif
|
||||
|
||||
# Uses __atomic_fetch_add_4
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
GERBERA_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
|
||||
|
||||
@@ -8,6 +8,7 @@ GRPC_VERSION = 1.37.0
|
||||
GRPC_SITE = $(call github,grpc,grpc,v$(GRPC_VERSION))
|
||||
GRPC_LICENSE = Apache-2.0
|
||||
GRPC_LICENSE_FILES = LICENSE
|
||||
GRPC_CPE_ID_VENDOR = grpc
|
||||
|
||||
GRPC_INSTALL_STAGING = YES
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ GST1_PLUGINS_BAD_INSTALL_STAGING = YES
|
||||
# GST1_PLUGINS_BAD_LICENSE_FILES if enabled.
|
||||
GST1_PLUGINS_BAD_LICENSE_FILES = COPYING
|
||||
GST1_PLUGINS_BAD_LICENSE = LGPL-2.0+
|
||||
GST1_PLUGINS_BAD_CPE_ID_VENDOR = freedesktop
|
||||
GST1_PLUGINS_BAD_CPE_ID_PRODUCT = gst-plugins-bad
|
||||
|
||||
GST1_PLUGINS_BAD_CFLAGS = $(TARGET_CFLAGS) -std=c99 -D_GNU_SOURCE
|
||||
GST1_PLUGINS_BAD_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)
|
||||
|
||||
@@ -9,6 +9,8 @@ GST1_RTSP_SERVER_SOURCE = gst-rtsp-server-$(GST1_RTSP_SERVER_VERSION).tar.xz
|
||||
GST1_RTSP_SERVER_SITE = http://gstreamer.freedesktop.org/src/gst-rtsp-server
|
||||
GST1_RTSP_SERVER_LICENSE = LGPL-2.0+
|
||||
GST1_RTSP_SERVER_LICENSE_FILES = COPYING COPYING.LIB
|
||||
GST1_RTSP_SERVER_CPE_ID_VENDOR = gstreamer_project
|
||||
GST1_RTSP_SERVER_CPE_ID_PRODUCT = gst-rtsp-server
|
||||
GST1_RTSP_SERVER_INSTALL_STAGING = YES
|
||||
GST1_RTSP_SERVER_DEPENDENCIES = \
|
||||
host-pkgconf \
|
||||
|
||||
@@ -10,6 +10,8 @@ GSTREAMER1_SITE = https://gstreamer.freedesktop.org/src/gstreamer
|
||||
GSTREAMER1_INSTALL_STAGING = YES
|
||||
GSTREAMER1_LICENSE_FILES = COPYING
|
||||
GSTREAMER1_LICENSE = LGPL-2.0+, LGPL-2.1+
|
||||
GSTREAMER1_CPE_ID_VENDOR = gstreamer_project
|
||||
GSTREAMER1_CPE_ID_PRODUCT = gstreamer
|
||||
|
||||
GSTREAMER1_CONF_OPTS = \
|
||||
-Dexamples=disabled \
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From 99cf89555313056d3a8fa54b21d02dc880b363e1 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <jouni@codeaurora.org>
|
||||
Date: Mon, 20 Apr 2020 20:29:31 +0300
|
||||
Subject: [PATCH] Include stdbool.h to allow C99 bool to be used
|
||||
|
||||
We have practically started requiring some C99 features, so might as
|
||||
well finally go ahead and bring in the C99 bool as well.
|
||||
|
||||
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
|
||||
[geomatsi@gmail.com: backport from upstream]
|
||||
Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
|
||||
[yann.morin.1998@free.fr: keep upstream sha1 in header, drop numbering]
|
||||
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
|
||||
---
|
||||
src/utils/includes.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/utils/includes.h b/src/utils/includes.h
|
||||
index 75513fc8c..741fc9c14 100644
|
||||
--- a/src/utils/includes.h
|
||||
+++ b/src/utils/includes.h
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
+#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 9a990e8c4eb92dd64e0ec483599820e45c35ac23 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 13 Mar 2021 23:14:23 +0200
|
||||
Subject: [PATCH] ASN.1: Add helper functions for recognizing tag values
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
[geomatsi@gmail.com: backport asn1_is_null() from upstream 9a990e8c4eb9]
|
||||
Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
|
||||
[yann.morin.1998@free.fr:
|
||||
- reformat, keep the upstream sha1 and title,
|
||||
- drop numbering
|
||||
]
|
||||
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
|
||||
---
|
||||
src/tls/asn1.h | 102 +++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 102 insertions(+)
|
||||
|
||||
diff --git a/src/tls/asn1.h b/src/tls/asn1.h
|
||||
index de3430adb..a4d1be473 100644
|
||||
--- a/src/tls/asn1.h
|
||||
+++ b/src/tls/asn1.h
|
||||
@@ -66,6 +66,12 @@ struct wpabuf * asn1_build_alg_id(const struct asn1_oid *oid,
|
||||
unsigned long asn1_bit_string_to_long(const u8 *buf, size_t len);
|
||||
int asn1_oid_equal(const struct asn1_oid *a, const struct asn1_oid *b);
|
||||
|
||||
+static inline bool asn1_is_null(const struct asn1_hdr *hdr)
|
||||
+{
|
||||
+ return hdr->class == ASN1_CLASS_UNIVERSAL &&
|
||||
+ hdr->tag == ASN1_TAG_NULL;
|
||||
+}
|
||||
+
|
||||
extern struct asn1_oid asn1_sha1_oid;
|
||||
extern struct asn1_oid asn1_sha256_oid;
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Locally computed
|
||||
sha256 e42a264b7b86e80d013d6d00062467352c1f37e0aaea10fe5b51e4d8687921ab intel-microcode-20201118.tar.gz
|
||||
sha256 d9e989e1a7747f3ce93cb749aceca67a430d36c9bebc6e3205e0b3af3ca6304b license
|
||||
sha256 b855c81f78705f35341248a0603aa1a6e199ca7f59cd425e061b579329aa9eaa intel-microcode-20210216.tar.gz
|
||||
sha256 03efb1491c7e899feb2665fa299363e64035e5444c1b8bc1f6ebed30de964e12 license
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
INTEL_MICROCODE_VERSION = 20201118
|
||||
INTEL_MICROCODE_VERSION = 20210216
|
||||
INTEL_MICROCODE_SITE = $(call github,intel,Intel-Linux-Processor-Microcode-Data-Files,microcode-$(INTEL_MICROCODE_VERSION))
|
||||
INTEL_MICROCODE_LICENSE = PROPRIETARY
|
||||
INTEL_MICROCODE_LICENSE_FILES = license
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
config BR2_PACKAGE_HOST_JH71XX_TOOLS
|
||||
bool "host jh71xx-tools"
|
||||
depends on BR2_riscv
|
||||
help
|
||||
Bootloader recovery and updater tool for StarFive JH7100 SoCs.
|
||||
|
||||
https://github.com/kprasadvnsi/JH71xx-tools
|
||||
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 0f16ea896164f6e8bfe0a03bbbd95ff14d474445ba6f045f9377d01282c9364f jh71xx-tools-7a29f4b9d2355aa39afa8680680909bb74e4991d.tar.gz
|
||||
sha256 cf03c59b41f6d8a5046f7bff4bbe3576075314299a4d0828d7855bf60af81001 LICENSE
|
||||
@@ -0,0 +1,20 @@
|
||||
################################################################################
|
||||
#
|
||||
# jh71xx-tools
|
||||
#
|
||||
################################################################################
|
||||
|
||||
JH71XX_TOOLS_VERSION = 7a29f4b9d2355aa39afa8680680909bb74e4991d
|
||||
JH71XX_TOOLS_SITE = $(call github,kprasadvnsi,JH71xx-tools,$(JH71XX_TOOLS_VERSION))
|
||||
JH71XX_TOOLS_LICENSE = MIT
|
||||
JH71XX_TOOLS_LICENSE_FILES = LICENSE
|
||||
|
||||
define HOST_JH71XX_TOOLS_BUILD_CMDS
|
||||
$(HOSTCC) -o $(@D)/jh7100-recover $(@D)/jh7100-recover.c
|
||||
endef
|
||||
|
||||
define HOST_JH71XX_TOOLS_INSTALL_CMDS
|
||||
$(INSTALL) -D -m 0755 $(@D)/jh7100-recover $(HOST_DIR)/bin/jh7100-recover
|
||||
endef
|
||||
|
||||
$(eval $(host-generic-package))
|
||||
@@ -1,3 +1,3 @@
|
||||
# Locally computed
|
||||
sha256 14efe6f1784ef6e97116b15c77b04b7e8f47ec07b1479bcd6fa0b081faa19440 jquery-validation-1.14.0.zip
|
||||
sha256 c2f9aa180de990ff16ca7e756c9af52ecc1b3536e3fb32649d7b2c510bccf9d0 README.md
|
||||
sha256 01ad2ef0a7f9cd413aeb51081651293916da47d20e5c0a59ec62587e58b03564 jquery-validation-1.19.3.zip
|
||||
sha256 3e5a99460077c16bf75f6821a30cdac9baa339119ebf63b2a6c49f4f50421ca4 README.md
|
||||
|
||||
@@ -4,11 +4,13 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
JQUERY_VALIDATION_VERSION = 1.14.0
|
||||
JQUERY_VALIDATION_SITE = http://jqueryvalidation.org/files
|
||||
JQUERY_VALIDATION_VERSION = 1.19.3
|
||||
JQUERY_VALIDATION_SITE = https://github.com/jquery-validation/jquery-validation/releases/download/$(JQUERY_VALIDATION_VERSION)
|
||||
JQUERY_VALIDATION_SOURCE = jquery-validation-$(JQUERY_VALIDATION_VERSION).zip
|
||||
JQUERY_VALIDATION_LICENSE = MIT
|
||||
JQUERY_VALIDATION_LICENSE_FILES = README.md
|
||||
JQUERY_VALIDATION_CPE_ID_VENDOR = jqueryvalidation
|
||||
JQUERY_VALIDATION_CPE_ID_PRODUCT = jquery_validation
|
||||
|
||||
define JQUERY_VALIDATION_EXTRACT_CMDS
|
||||
$(UNZIP) -d $(@D) $(JQUERY_VALIDATION_DL_DIR)/$(JQUERY_VALIDATION_SOURCE)
|
||||
|
||||
@@ -9,6 +9,7 @@ KEEPALIVED_SITE = http://www.keepalived.org/software
|
||||
KEEPALIVED_DEPENDENCIES = host-pkgconf openssl
|
||||
KEEPALIVED_LICENSE = GPL-2.0+
|
||||
KEEPALIVED_LICENSE_FILES = COPYING
|
||||
KEEPALIVED_CPE_ID_VENDOR = keepalived
|
||||
KEEPALIVED_CONF_OPTS = --disable-hardening
|
||||
|
||||
ifeq ($(BR2_PACKAGE_JSON_C),y)
|
||||
|
||||
@@ -35,6 +35,7 @@ config BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_WAYLAND
|
||||
depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND # waylandpp
|
||||
depends on BR2_HOST_GCC_AT_LEAST_4_9 # waylandpp
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # waylandpp
|
||||
depends on BR2_INSTALL_LIBSTDCPP # waylandpp
|
||||
depends on BR2_PACKAGE_WAYLAND # waylandpp
|
||||
select BR2_PACKAGE_KODI_PLATFORM_SUPPORTS
|
||||
select BR2_PACKAGE_LIBXKBCOMMON
|
||||
|
||||
@@ -6,10 +6,14 @@
|
||||
|
||||
# When updating the version, please also update kodi-jsonschemabuilder
|
||||
# and kodi-texturepacker
|
||||
KODI_VERSION = 19.1-Matrix
|
||||
KODI_VERSION_MAJOR = 19.1
|
||||
KODI_VERSION_NAME = Matrix
|
||||
KODI_VERSION = $(KODI_VERSION_MAJOR)-$(KODI_VERSION_NAME)
|
||||
KODI_SITE = $(call github,xbmc,xbmc,$(KODI_VERSION))
|
||||
KODI_LICENSE = GPL-2.0
|
||||
KODI_LICENSE_FILES = LICENSE.md
|
||||
KODI_CPE_ID_VENDOR = kodi
|
||||
KODI_CPE_ID_VERSION = $(KODI_VERSION_MAJOR)
|
||||
# needed for binary addons
|
||||
KODI_INSTALL_STAGING = YES
|
||||
# kodi recommends building out-of-source
|
||||
|
||||
@@ -8,6 +8,7 @@ LESS_VERSION = 563
|
||||
LESS_SITE = http://www.greenwoodsoftware.com/less
|
||||
LESS_LICENSE = GPL-3.0+
|
||||
LESS_LICENSE_FILES = COPYING
|
||||
LESS_CPE_ID_VENDOR = gnu
|
||||
LESS_DEPENDENCIES = ncurses
|
||||
|
||||
define LESS_INSTALL_TARGET_CMDS
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# From https://lists.freedesktop.org/archives/dri-devel/2021-April/302515.html
|
||||
sha256 1d1d024b7cadc63e2b59cddaca94f78864940ab440843841113fbac6afaf2a46 libdrm-2.4.105.tar.xz
|
||||
sha512 083a04af7208e58be21b89c6ebdbe2db3ba00cd29f0d271bd38bfe97dfca741edafddaaf9b5b95c20fac2c9b700434ea5b21397de26f7073169ad6f5b090f715 libdrm-2.4.105.tar.xz
|
||||
# From https://lists.freedesktop.org/archives/dri-devel/2021-May/307025.html
|
||||
sha256 92d8ac54429b171e087e61c2894dc5399fe6a549b1fbba09fa6a3cb9d4e57bd4 libdrm-2.4.106.tar.xz
|
||||
sha512 33140e579906ab54b716149056af500c628ce41cd9ae3b0c33496693d2f5903fbcfccee8a942dd1560e1591111ed240da42612d5af5e75558db6f6a85d14617d libdrm-2.4.106.tar.xz
|
||||
|
||||
# Hash for license file
|
||||
sha256 a69e38953c20a88845cc739c05dd604da4c977844b872e126c91a0ca2e1385b7 xf86drm.c
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LIBDRM_VERSION = 2.4.105
|
||||
LIBDRM_VERSION = 2.4.106
|
||||
LIBDRM_SOURCE = libdrm-$(LIBDRM_VERSION).tar.xz
|
||||
LIBDRM_SITE = https://dri.freedesktop.org/libdrm
|
||||
LIBDRM_LICENSE = MIT
|
||||
|
||||
@@ -11,6 +11,8 @@ LIBEXOSIP2_SITE = http://download.savannah.gnu.org/releases/exosip
|
||||
LIBEXOSIP2_INSTALL_STAGING = YES
|
||||
LIBEXOSIP2_LICENSE = GPL-2.0+
|
||||
LIBEXOSIP2_LICENSE_FILES = COPYING
|
||||
LIBEXOSIP2_CPE_ID_VENDOR = gnu
|
||||
LIBEXOSIP2_CPE_ID_PRODUCT = exosip
|
||||
|
||||
LIBEXOSIP2_DEPENDENCIES = host-pkgconf libosip2
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ LIBFUSE_SOURCE = fuse-$(LIBFUSE_VERSION).tar.gz
|
||||
LIBFUSE_SITE = https://github.com/libfuse/libfuse/releases/download/fuse-$(LIBFUSE_VERSION)
|
||||
LIBFUSE_LICENSE = GPL-2.0, LGPL-2.1
|
||||
LIBFUSE_LICENSE_FILES = COPYING COPYING.LIB
|
||||
LIBFUSE_CPE_ID_VENDOR = libfuse_project
|
||||
LIBFUSE_INSTALL_STAGING = YES
|
||||
LIBFUSE_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv)
|
||||
LIBFUSE_CONF_OPTS = \
|
||||
|
||||
@@ -8,6 +8,8 @@ LIBFUSE3_VERSION = 3.10.3
|
||||
LIBFUSE3_SITE = $(call github,libfuse,libfuse,fuse-$(LIBFUSE3_VERSION))
|
||||
LIBFUSE3_LICENSE = LGPL-2.1
|
||||
LIBFUSE3_LICENSE_FILES = LICENSE
|
||||
LIBFUSE3_CPE_ID_VENDOR = libfuse_project
|
||||
LIBFUSE3_CPE_ID_PRODUCT = libfuse
|
||||
LIBFUSE3_INSTALL_STAGING = YES
|
||||
LIBFUSE3_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv)
|
||||
LIBFUSE3_CONF_OPTS = \
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user