From: Peter Johnson Date: Sun, 16 Oct 2005 08:48:24 +0000 (-0000) Subject: * gas-bison.y, gas-token.re: Implement .weak directive. X-Git-Tag: v0.5.0rc1~92 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ab76706900f5f3186df95496a9dea9334ca8273;p=yasm * gas-bison.y, gas-token.re: Implement .weak directive. svn path=/trunk/yasm/; revision=1286 --- diff --git a/modules/parsers/gas/gas-bison.y b/modules/parsers/gas/gas-bison.y index 8885fea7..794329a3 100644 --- a/modules/parsers/gas/gas-bison.y +++ b/modules/parsers/gas/gas-bison.y @@ -105,7 +105,7 @@ static void gas_parser_directive %token DIR_EQU DIR_FILE DIR_FLOAT DIR_GLOBAL DIR_IDENT DIR_INT DIR_LOC %token DIR_LCOMM DIR_OCTA DIR_ORG DIR_P2ALIGN DIR_REPT DIR_SECTION %token DIR_SHORT DIR_SIZE DIR_SKIP DIR_STRING -%token DIR_TEXT DIR_TFLOAT DIR_TYPE DIR_QUAD DIR_WORD DIR_ZERO +%token DIR_TEXT DIR_TFLOAT DIR_TYPE DIR_QUAD DIR_WEAK DIR_WORD DIR_ZERO %type line lineexp instr @@ -205,6 +205,20 @@ lineexp: instr yasm_xfree($2); $$ = NULL; } + | DIR_WEAK label_id { + yasm_valparamhead vps; + yasm_valparam *vp; + + yasm_vps_initialize(&vps); + vp = yasm_vp_create($2, NULL); + yasm_vps_append(&vps, vp); + + yasm_objfmt_directive(parser_gas->objfmt, "weak", &vps, NULL, + cur_line); + + yasm_vps_delete(&vps); + $$ = NULL; + } | DIR_LCOMM label_id ',' expr { /* Put into .bss section. */ /*@dependent@*/ yasm_section *bss = diff --git a/modules/parsers/gas/gas-token.re b/modules/parsers/gas/gas-token.re index 25fbe3eb..48c489a1 100644 --- a/modules/parsers/gas/gas-token.re +++ b/modules/parsers/gas/gas-token.re @@ -297,6 +297,7 @@ scan: '.tfloat' { RETURN(DIR_TFLOAT); } '.type' { RETURN(DIR_TYPE); } '.quad' { RETURN(DIR_QUAD); } + '.weak' { RETURN(DIR_WEAK); } '.word' { RETURN(DIR_WORD); } '.zero' { RETURN(DIR_ZERO); }