From: Jakub Jelinek Date: Wed, 17 Aug 2005 10:08:30 +0000 (+0000) Subject: * ldgram.y (vers_defns): Don't lose pattern list before X-Git-Tag: gdb-csl-arm-20051020-branchpoint~430 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96f8ade54630830d0707c22ae531d32baa3c9966;p=external%2Fbinutils.git * ldgram.y (vers_defns): Don't lose pattern list before extern NAME {}. Handle global, local and extern symbol names. ld/testsuite/ * ld-elfvers/vers.exp: Add a new test, vers30. * ld-elfvers/vers30.c: New file. * ld-elfvers/vers30.map: New file. * ld-elfvers/vers30.ver: New file. * ld-elfvers/vers30.dsym: New file. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index c64fa8d..0d31afc 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2005-08-17 Jakub Jelinek + + * ldgram.y (vers_defns): Don't lose pattern list before + extern NAME {}. Handle global, local and extern symbol names. + 2005-08-17 Kaz Kojima * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation): diff --git a/ld/ldgram.y b/ld/ldgram.y index 44896e1..c8cf6c1 100644 --- a/ld/ldgram.y +++ b/ld/ldgram.y @@ -1226,6 +1226,9 @@ vers_defns: } vers_defns opt_semicolon '}' { + struct bfd_elf_version_expr *pat; + for (pat = $7; pat->next != NULL; pat = pat->next); + pat->next = $1; $$ = $7; ldgram_vers_current_lang = $6; } @@ -1239,6 +1242,30 @@ vers_defns: $$ = $5; ldgram_vers_current_lang = $4; } + | GLOBAL + { + $$ = lang_new_vers_pattern (NULL, "global", ldgram_vers_current_lang); + } + | vers_defns ';' GLOBAL + { + $$ = lang_new_vers_pattern ($1, "global", ldgram_vers_current_lang); + } + | LOCAL + { + $$ = lang_new_vers_pattern (NULL, "local", ldgram_vers_current_lang); + } + | vers_defns ';' LOCAL + { + $$ = lang_new_vers_pattern ($1, "local", ldgram_vers_current_lang); + } + | EXTERN + { + $$ = lang_new_vers_pattern (NULL, "extern", ldgram_vers_current_lang); + } + | vers_defns ';' EXTERN + { + $$ = lang_new_vers_pattern ($1, "extern", ldgram_vers_current_lang); + } ; opt_semicolon: diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 14e0877..8f0af1a 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2005-08-17 Jakub Jelinek + + * ld-elfvers/vers.exp: Add a new test, vers30. + * ld-elfvers/vers30.c: New file. + * ld-elfvers/vers30.map: New file. + * ld-elfvers/vers30.ver: New file. + * ld-elfvers/vers30.dsym: New file. + 2005-08-17 Alan Modra * ld-alpha/tlsbin.rd: Update. diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp index d67ce7b..bc11550 100644 --- a/ld/testsuite/ld-elfvers/vers.exp +++ b/ld/testsuite/ld-elfvers/vers.exp @@ -960,3 +960,7 @@ build_vers_lib_pic "vers28a" vers28a.c vers28a "" "" vers28a.ver vers28a.dsym "" build_vers_lib_pic "vers28b" vers28b.c vers28b "" vers28b.map vers28b.ver vers28b.dsym "" build_vers_lib_pic "vers28c" vers28c.c vers28c "vers28b.so vers28a.so" "" vers28c.ver vers28c.dsym "" build_vers_lib_pic_flags "vers29" vers29.c vers29 "" "" vers29.ver vers29.dsym "" "--default-symver" + +# Test #30 - test handling of symbol names global, local and extern in the +# version script. +build_vers_lib_pic "vers30" vers30.c vers30 "" vers30.map vers30.ver vers30.dsym "" diff --git a/ld/testsuite/ld-elfvers/vers30.c b/ld/testsuite/ld-elfvers/vers30.c new file mode 100644 index 0000000..65dba2f --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers30.c @@ -0,0 +1,7 @@ +void global (void) {} +void local (void) {} +void foo (void) {} +void bar (void) {} +void info (void) {} +void baz (void) __asm ("extern"); +void baz (void) {} diff --git a/ld/testsuite/ld-elfvers/vers30.dsym b/ld/testsuite/ld-elfvers/vers30.dsym new file mode 100644 index 0000000..1f358d4 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers30.dsym @@ -0,0 +1,5 @@ +[0]* g DO \*ABS\* [0]* VERS_30.0 VERS_30.0 +[0-9a-f]* g DF (.text|\*ABS\*) [0-9a-f]* VERS_30.0 global +[0-9a-f]* g DF (.text|\*ABS\*) [0-9a-f]* VERS_30.0 foo +[0-9a-f]* g DF (.text|\*ABS\*) [0-9a-f]* VERS_30.0 info +[0-9a-f]* g DF (.text|\*ABS\*) [0-9a-f]* VERS_30.0 extern diff --git a/ld/testsuite/ld-elfvers/vers30.map b/ld/testsuite/ld-elfvers/vers30.map new file mode 100644 index 0000000..71d06d3 --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers30.map @@ -0,0 +1,6 @@ +VERS_30.0 { + global: + foo; info; global; extern "C" { extern; }; + local: + local; bar; *; +}; diff --git a/ld/testsuite/ld-elfvers/vers30.ver b/ld/testsuite/ld-elfvers/vers30.ver new file mode 100644 index 0000000..dfcf0da --- /dev/null +++ b/ld/testsuite/ld-elfvers/vers30.ver @@ -0,0 +1,4 @@ +Version definitions: +1 0x01 0x0966695f vers30.so +2 0x00 0x079239b0 VERS_30.0 +