* 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.
This commit is contained in:
Jakub Jelinek 2005-08-17 10:08:30 +00:00
parent 8d1d654fb4
commit 96f8ade546
8 changed files with 66 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2005-08-17 Jakub Jelinek <jakub@redhat.com>
* ldgram.y (vers_defns): Don't lose pattern list before
extern NAME {}. Handle global, local and extern symbol names.
2005-08-17 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation):

View File

@ -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 = $<name>6;
}
@ -1239,6 +1242,30 @@ vers_defns:
$$ = $5;
ldgram_vers_current_lang = $<name>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:

View File

@ -1,3 +1,11 @@
2005-08-17 Jakub Jelinek <jakub@redhat.com>
* 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 <amodra@bigpond.net.au>
* ld-alpha/tlsbin.rd: Update.

View File

@ -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 ""

View File

@ -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) {}

View File

@ -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

View File

@ -0,0 +1,6 @@
VERS_30.0 {
global:
foo; info; global; extern "C" { extern; };
local:
local; bar; *;
};

View File

@ -0,0 +1,4 @@
Version definitions:
1 0x01 0x0966695f vers30.so
2 0x00 0x079239b0 VERS_30.0