mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-27 08:10:07 +08:00
98578071b9
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>
39 lines
360 B
NASM
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
|