summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2020-03-31 10:23:43 -0700
committerH. Peter Anvin <hpa@zytor.com>2020-03-31 10:23:43 -0700
commit2cd1a6fb70b8f60a3b4e5496ac823249ced8a1f0 (patch)
tree6549bd2179c4bae2d26c9cf222cee5aa73d4f2e3
parente91f5cc1322eed4da0de81656276e021bf352c3d (diff)
downloadnasm-2cd1a6fb70b8f60a3b4e5496ac823249ced8a1f0.tar.gz
test: test case for BR 3392655, overflow during bin format link
The bin format linker should warn if a relocation overflows its virtual address. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--test/binoverflow.asm37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/binoverflow.asm b/test/binoverflow.asm
new file mode 100644
index 00000000..55b48e85
--- /dev/null
+++ b/test/binoverflow.asm
@@ -0,0 +1,37 @@
+;; BR 3392655: relocation overflow during bin format link
+
+ [map all binoverflow.map]
+
+ org 7C00h
+
+%macro br3392655 1
+ bits %1
+
+ section .text.%1
+start%1:
+
+mov al, var%1
+%if %1 == 64
+mov sil, var%1
+%endif
+
+mov al, foo%1
+%if %1 == 64
+mov sil, foo%1
+%endif
+
+mov al, start%1
+%if %1 == 64
+mov sil, start%1
+%endif
+
+ align 16
+var%1: db 0
+
+ align 256
+foo%1: db 0
+%endmacro
+
+ br3392655 16
+ br3392655 32
+ br3392655 64