From 7fcd9898f499d5944aaa2e010044f4619b65c4cf Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 7 Mar 2017 23:03:11 -0800 Subject: [PATCH] doc: document subsections_via_symbols Document the subsections_via_symbols directive. Signed-off-by: H. Peter Anvin --- doc/changes.src | 3 +++ doc/nasmdoc.src | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/doc/changes.src b/doc/changes.src index 3d87fbae..a24ddf21 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -23,6 +23,9 @@ since 2007. \b NASM can now generate sparse output files for relevant output formats, if the underlying operating system supports them. +\b \c{macho} object format now supports the \c{subsections_via_symbols} + directive, see \k{macho-ssvs}. + \S{cl-2.12.03} Version 2.12.03 \b Add new warnings for certain dangerous constructs which never ought diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 12cc429b..d2e9bd24 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -1,6 +1,6 @@ \# -------------------------------------------------------------------------- \# -\# Copyright 1996-2016 The NASM Authors - All Rights Reserved +\# Copyright 1996-2017 The NASM Authors - All Rights Reserved \# See the file AUTHORS included with the NASM distribution for \# the specific copyright holders. \# @@ -36,7 +36,7 @@ \M{category}{Programming} \M{title}{NASM - The Netwide Assembler} -\M{year}{1996-2016} +\M{year}{1996-2017} \M{author}{The NASM Development Team} \M{copyright_tail}{-- All Rights Reserved} \M{license}{This document is redistributable under the license given in the file "LICENSE" distributed in the NASM archive.} @@ -5758,6 +5758,21 @@ right-hand side of the \c{WRT} operator: \b \c{..gotpcrel} is used to specify references to the Global Offset Table. The GOT is supported in the \c{macho64} format only. +\S{macho-ssvs} \c{macho} specfic directive \i\c{subsections_via_symbols} + +The directive \c{subsections_via_symbols} sets the +\c{MH_SUBSECTIONS_VIA_SYMBOLS} flag in the Mach-O header, which tells +the linker that the symbols in the file matches the conventions +required to allow for link-time dead code elimination. + +This directive takes no arguments. Like most directives, it is +wrapped in a macro; it is therefore possible to support older versions +of NASM (without the dead code elimination support) simply by: + +\c %ifnmacro subsections_via_symbols +\c %imacro subsections_via_symbols 0 +\c %endmacro +\c %endif \H{elffmt} \i\c{elf32}, \i\c{elf64}, \i\c{elfx32}: \I{ELF}\I{linux, elf}\i{Executable and Linkable Format} Object Files