This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, hjl/secondary, created. glibc-2.16-1-gb0ce650
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 30 Jun 2012 19:54:43 -0000
- Subject: GNU C Library master sources branch, hjl/secondary, created. glibc-2.16-1-gb0ce650
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, hjl/secondary has been created
at b0ce6503ac09284aafb7fd455a13f15442545524 (commit)
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b0ce6503ac09284aafb7fd455a13f15442545524
commit b0ce6503ac09284aafb7fd455a13f15442545524
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Jun 30 12:53:04 2012 -0700
Add STB_SECONDARY support
diff --git a/ChangeLog.second b/ChangeLog.second
new file mode 100644
index 0000000..ad3eba0
--- /dev/null
+++ b/ChangeLog.second
@@ -0,0 +1,7 @@
+2012-06-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf/dl-addr.c (determine_info): Also check STB_SECONDARY.
+ * elf/dl-lookup.c (do_lookup_x): Handle STB_SECONDARY.
+ (_dl_lookup_symbol_x): Likewise.
+ * elf/sprof.c (read_symbols): Likewise.
+ * elf/elf.h (STB_SECONDARY): New.
diff --git a/elf/dl-addr.c b/elf/dl-addr.c
index 498faf1..dc2aca3 100644
--- a/elf/dl-addr.c
+++ b/elf/dl-addr.c
@@ -87,7 +87,8 @@ determine_info (const ElfW(Addr) addr, struct link_map *match, Dl_info *info,
for (; (void *) symtab < (void *) symtabend; ++symtab)
if ((ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
- || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK)
+ || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK
+ || ELFW(ST_BIND) (symtab->st_info) == STB_SECONDARY)
&& ELFW(ST_TYPE) (symtab->st_info) != STT_TLS
&& (symtab->st_shndx != SHN_UNDEF
|| symtab->st_value != 0)
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index a2a699b..877eb76 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -285,10 +285,15 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
found_it:
switch (__builtin_expect (ELFW(ST_BIND) (sym->st_info), STB_GLOBAL))
{
+ case STB_SECONDARY:
+ /* Secondary definition. Use this value if we don't find
+ another. */
+ goto dynamic_weak;
case STB_WEAK:
/* Weak definition. Use this value if we don't find another. */
if (__builtin_expect (GLRO(dl_dynamic_weak), 0))
{
+dynamic_weak:
if (! result->s)
{
result->s = sym;
@@ -768,7 +773,9 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
if (__builtin_expect (current_value.s == NULL, 0))
{
- if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK)
+ if ((*ref == NULL
+ || (ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK
+ && ELFW(ST_BIND) ((*ref)->st_info) != STB_SECONDARY))
&& skip_map == NULL
&& !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED))
{
diff --git a/elf/elf.h b/elf/elf.h
index 6522ea6..9802f8a 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -444,7 +444,8 @@ typedef struct
#define STB_LOCAL 0 /* Local symbol */
#define STB_GLOBAL 1 /* Global symbol */
#define STB_WEAK 2 /* Weak symbol */
-#define STB_NUM 3 /* Number of defined types. */
+#define STB_SECONDARY 3 /* Secondary symbol */
+#define STB_NUM 4 /* Number of defined types. */
#define STB_LOOS 10 /* Start of OS-specific */
#define STB_GNU_UNIQUE 10 /* Unique symbol. */
#define STB_HIOS 12 /* End of OS-specific */
diff --git a/elf/sprof.c b/elf/sprof.c
index 2097d31..2325180 100644
--- a/elf/sprof.c
+++ b/elf/sprof.c
@@ -1078,7 +1078,8 @@ read_symbols (struct shobj *shobj)
newsym->name = &shobj->strtab[sym->st_name];
newsym->addr = sym->st_value;
newsym->size = sym->st_size;
- newsym->weak = ELFW(ST_BIND) (sym->st_info) == STB_WEAK;
+ newsym->weak = (ELFW(ST_BIND) (sym->st_info) == STB_SECONDARY
+ || ELFW(ST_BIND) (sym->st_info) == STB_WEAK);
newsym->hidden = (ELFW(ST_VISIBILITY) (sym->st_other)
!= STV_DEFAULT);
newsym->ticks = 0;
@@ -1136,7 +1137,8 @@ read_symbols (struct shobj *shobj)
newsym->name = &strtab[symtab->st_name];
newsym->addr = symtab->st_value;
newsym->size = symtab->st_size;
- newsym->weak = ELFW(ST_BIND) (symtab->st_info) == STB_WEAK;
+ newsym->weak = (ELFW(ST_BIND) (symtab->st_info) == STB_SECONDARY
+ || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK);
newsym->hidden = (ELFW(ST_VISIBILITY) (symtab->st_other)
!= STV_DEFAULT);
newsym->ticks = 0;
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources