diff options
author | hbono@chromium.org <hbono@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c> | 2011-02-04 04:35:36 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c> | 2011-02-04 04:35:36 +0000 |
commit | 44efe151b6960bab3db0c85354cc4cce1024219d (patch) | |
tree | f7ad8faf928562b891c3b76d8b2a035bfc94ed25 | |
parent | a1b5233e6d340f45f4846131fec9d0b92e203ce4 (diff) | |
download | patched-yasm-44efe151b6960bab3db0c85354cc4cce1024219d.tar.gz |
Support the N_PEXT bit of the Mach-O object format.
This change allows us to set the N_PEXT bit to Mach-O object files when a global symbol has a 'private_extern' extension.
BUG=http://www.tortall.net/projects/yasm/ticket/236
TEST=none
Review URL: http://codereview.chromium.org/6347060
git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/yasm/patched-yasm@73761 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
-rw-r--r-- | modules/objfmts/macho/macho-objfmt.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/modules/objfmts/macho/macho-objfmt.c b/modules/objfmts/macho/macho-objfmt.c index a6f8282..4adb38d 100644 --- a/modules/objfmts/macho/macho-objfmt.c +++ b/modules/objfmts/macho/macho-objfmt.c @@ -922,7 +922,26 @@ macho_objfmt_output_symtable(yasm_symrec *sym, /*@null@*/ void *d) } /*printf("common symbol %s val %lu\n", name, yasm_intnum_get_uint(val));*/ } else if (vis & YASM_SYM_GLOBAL) { - n_type |= N_EXT; + yasm_valparamhead *valparams = + yasm_symrec_get_objext_valparams(sym); + + struct macho_global_data { + unsigned long flag; /* N_PEXT */ + } data; + + data.flag = 0; + + if (valparams) { + static const yasm_dir_help help[] = { + { "private_extern", 0, yasm_dir_helper_flag_set, + offsetof(struct macho_global_data, flag), N_PEXT }, + }; + yasm_dir_helper(sym, yasm_vps_first(valparams), + yasm_symrec_get_decl_line(sym), help, NELEMS(help), + &data, yasm_dir_helper_valparam_warn); + } + + n_type |= N_EXT | data.flag; } localbuf = info->buf; |