nasm/test/subsection.asm
H. Peter Anvin 98578071b9 Cleanup of label renaming infrastructure, add subsection support
In order to support Mach-O better, add support for subsections, as
used by Mach-O "subsections_via_symbols". We also want to add
infrastructure to support this by downcalling to the backend to
indicate if a new subsection is needed.

Currently this supports a maximum of 2^14 subsections per section for
Mach-O; this can be addressed by adding a level of indirection (or
cleaning up the handling of sections so we have an actual data
structure.)

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2018-06-01 18:06:25 -07:00

39 lines
360 B
NASM

;
; subsection.asm
;
; Test of Mach-O subsection_by_symbol
;
%pragma output subsections_via_symbols
%pragma asm gprefix _
%pragma asm lprefix L_
bits 32
global foo, bar
static quux
foo:
jmp foo
jmp bar
jmp baz
jmp quux
bar:
jmp foo
jmp bar
jmp baz
jmp quux
baz:
jmp foo
jmp bar
jmp baz
jmp quux
quux:
jmp foo
jmp bar
jmp baz
jmp quux