summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-02-27 07:48:07 -0800
committerH. Peter Anvin <hpa@zytor.com>2009-02-27 07:48:07 -0800
commitfc7c93a512f03a4ac912d4c16c3e601e199864a2 (patch)
treefdaba933c9669c5137cb454ce0cdf934194f6c7c
parent7ea0d78e6b84abbc66591125fd5754a1a205a25f (diff)
downloadsyslinux-fc7c93a512f03a4ac912d4c16c3e601e199864a2.tar.gz
isohdpfx: work around gas/ld miscompilation
Some, unknown, version of gas or ld miscompiles a relative jump to an absolute symbol, resulting in a broken isohybrid. Implement a workaround for it by using a far jmp, which is absolute. Fortunately, the isohybrid prefix is one of the very few boot sectors we have which isn't short on space.
-rw-r--r--mbr/isohdpfx.S10
1 files changed, 9 insertions, 1 deletions
diff --git a/mbr/isohdpfx.S b/mbr/isohdpfx.S
index 9a97a5ee..ecb3a1a0 100644
--- a/mbr/isohdpfx.S
+++ b/mbr/isohdpfx.S
@@ -143,7 +143,15 @@ next:
cli
movw $heads, %sp
- jmp isolinux_start_hybrid
+
+ /*
+ * Use a ljmpw here to work around a bug in some unknown version
+ * of gas or ld when it comes to jumping to an absolute symbol...
+ *
+ * Look more closely into it if we ever are short on space.
+ */
+ ljmpw $0, $isolinux_start_hybrid
+ jmpw *%si
bad_signature:
call error