diff options
author | H. Peter Anvin <hpa@zytor.com> | 2017-03-14 18:43:57 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2017-03-14 18:46:31 -0700 |
commit | 9f16cfde4cccaa2d62fdbc55f01d2c3891789110 (patch) | |
tree | 5ab258dd727470ba70dbf66acf31d95e9912ec20 /include/nasm.h | |
parent | b852d351f62a239d784b008d6b5058955c359136 (diff) | |
download | nasm-9f16cfde4cccaa2d62fdbc55f01d2c3891789110.tar.gz |
macho: implement do_dead_strip, make subsections_by_symbols a pragma
Implement the MachO do_dead_strip directive, which sets a flag on the
corresponding section. This as well as subsections_by_symbols are
reimplemented as pragmas; if someone uses the predefined macro they
still get the expected behavior.
However, this allows someone to write:
%pragma macho subsections_by_symbols
... and have it ignored if compiling for, say, ELF.
Also, implement the following section attributes:
zerofill, no_dead_strip, live_support, strip_static_syms
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'include/nasm.h')
-rw-r--r-- | include/nasm.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/nasm.h b/include/nasm.h index 146c727b..61e56344 100644 --- a/include/nasm.h +++ b/include/nasm.h @@ -409,6 +409,23 @@ extern const struct preproc_ops preproc_nop; #define isnumchar(c) (nasm_isalnum(c) || (c) == '_') /* + * inline function to skip past an identifier; returns the first character past + * the identifier if valid, otherwise NULL. + */ +static inline char *nasm_skip_identifier(const char *str) +{ + const char *p = str; + + if (!isidstart(*p++)) { + p = NULL; + } else { + while (isidchar(*p++)) + ; + } + return (char *)p; +} + +/* * Data-type flags that get passed to listing-file routines. */ enum { |