From e46bcb7d3808394285c335a2f16d54a73e6fde00 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Tue, 20 Jun 2017 07:25:38 +0000 Subject: [PATCH] Decrease relative branch brittleness. Replace conditional branches with trampolines to unconditional branches when jumping to labels within other compilation units. This increases the offset range from +-1 MiB to +-128 MiB. --- lib/libc/aarch64/gen/sigsetjmp.S | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/libc/aarch64/gen/sigsetjmp.S b/lib/libc/aarch64/gen/sigsetjmp.S index be49f534387..917e1ef6ee5 100644 --- a/lib/libc/aarch64/gen/sigsetjmp.S +++ b/lib/libc/aarch64/gen/sigsetjmp.S @@ -34,8 +34,10 @@ __FBSDID("$FreeBSD$"); ENTRY(sigsetjmp) cmp x1, #0 - b.eq _C_LABEL(_setjmp) + b.eq 1f b _C_LABEL(setjmp) +1: + b _C_LABEL(_setjmp) END(sigsetjmp) ENTRY(siglongjmp) @@ -45,8 +47,10 @@ ENTRY(siglongjmp) /* Check the magic */ cmp x2, x3 - b.eq _C_LABEL(_longjmp) + b.eq 1f b _C_LABEL(longjmp) +1: + b _C_LABEL(_longjmp) .align 3 .Lmagic: .quad _JB_MAGIC__SETJMP