]> git.pld-linux.org Git - packages/mold.git/blobdiff - arm-exception-crash.patch
up to 1.4.2
[packages/mold.git] / arm-exception-crash.patch
diff --git a/arm-exception-crash.patch b/arm-exception-crash.patch
deleted file mode 100644 (file)
index e762e53..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-From 71daaa22dfaa3a99599c08b0d6681cb05b18e4ae Mon Sep 17 00:00:00 2001
-From: Rui Ueyama <ruiu@bluewhale.systems>
-Date: Sat, 20 Aug 2022 21:19:33 +0800
-Subject: [PATCH] [ELF] Fix ARM32 exception handling
-
-Fixes https://github.com/rui314/mold/issues/646
----
- elf/arch-arm32.cc    |  8 ++++----
- test/elf/issue646.sh | 40 ++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 44 insertions(+), 4 deletions(-)
- create mode 100755 test/elf/issue646.sh
-
-diff --git a/elf/arch-arm32.cc b/elf/arch-arm32.cc
-index a470136d..473f50e1 100644
---- a/elf/arch-arm32.cc
-+++ b/elf/arch-arm32.cc
-@@ -583,9 +583,9 @@ void sort_arm_exidx(Context<E> &ctx) {
-   tbb::parallel_for((i64)0, num_entries, [&](i64 i) {
-     i64 offset = sizeof(Entry) * i;
--    ent[i].addr = sign_extend(ent[i].addr, 30) - offset;
-+    ent[i].addr = sign_extend(ent[i].addr, 30) + offset;
-     if (is_relative(ent[i].val))
--      ent[i].val = 0x7fff'ffff & (sign_extend(ent[i].val, 30) - offset);
-+      ent[i].val = 0x7fff'ffff & (sign_extend(ent[i].val, 30) + offset);
-   });
-   tbb::parallel_sort(ent, ent + num_entries, [](const Entry &a, const Entry &b) {
-@@ -595,9 +595,9 @@ void sort_arm_exidx(Context<E> &ctx) {
-   // Write back the sorted records while adjusting relative addresses
-   tbb::parallel_for((i64)0, num_entries, [&](i64 i) {
-     i64 offset = sizeof(Entry) * i;
--    ent[i].addr = 0x7fff'ffff & (ent[i].addr + offset);
-+    ent[i].addr = 0x7fff'ffff & (ent[i].addr - offset);
-     if (is_relative(ent[i].val))
--      ent[i].val = 0x7fff'ffff & (ent[i].val + offset);
-+      ent[i].val = 0x7fff'ffff & (ent[i].val - offset);
-   });
- }
-diff --git a/test/elf/issue646.sh b/test/elf/issue646.sh
-new file mode 100755
-index 00000000..816fca9b
---- /dev/null
-+++ b/test/elf/issue646.sh
-@@ -0,0 +1,40 @@
-+#!/bin/bash
-+export LC_ALL=C
-+set -e
-+CC="${TEST_CC:-cc}"
-+CXX="${TEST_CXX:-c++}"
-+GCC="${TEST_GCC:-gcc}"
-+GXX="${TEST_GXX:-g++}"
-+OBJDUMP="${OBJDUMP:-objdump}"
-+MACHINE="${MACHINE:-$(uname -m)}"
-+testname=$(basename "$0" .sh)
-+echo -n "Testing $testname ... "
-+t=out/test/elf/$MACHINE/$testname
-+mkdir -p $t
-+
-+cat <<EOF | $CXX -o $t/a.o -c -xc++ -
-+#include <iostream>
-+#include <stdexcept>
-+
-+class Foo : public std::runtime_error {
-+public:
-+  using std::runtime_error::runtime_error;
-+};
-+
-+static void do_throw() {
-+  throw Foo("exception");
-+}
-+
-+int main() {
-+  try {
-+    do_throw();
-+  } catch (const Foo &e) {
-+    std::cout << "error: " << e.what() << std::endl;
-+  }
-+}
-+EOF
-+
-+$CXX -B. -o $t/exe $t/a.o
-+$QEMU $t/exe | grep -q 'error: exception'
-+
-+echo OK
This page took 0.161546 seconds and 4 git commands to generate.