This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] _dl_fini: Remove internal_function attribute
- From: fweimer at redhat dot com (Florian Weimer)
- To: libc-alpha at sourceware dot org
- Date: Mon, 14 Aug 2017 12:29:10 +0200
- Subject: [PATCH] _dl_fini: Remove internal_function attribute
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 360837F413
Assembler code passes the address of _dl_fini to __libc_start_main,
whose function pointer argument lacks the attribute. This means
that calls could use the wrong ABI. Fortunately, for zero-parameter
void-returning functions, internal_function does not change ABI
on i386 (the only architecture which uses internal_function), so
this inconsistency was harmless (which is why it had not been
noticed so far).
2017-08-14 Florian Weimer <fweimer@redhat.com>
* elf/dl-fini.c (_dl_fini): Remove internal_function
* sysdeps/generic/ldsodefs.h (_dl_fini): Likewise.
diff --git a/elf/dl-fini.c b/elf/dl-fini.c
index 93b337bea1..d6201b2c81 100644
--- a/elf/dl-fini.c
+++ b/elf/dl-fini.c
@@ -125,7 +125,6 @@ _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used, Lmid_t ns)
void
-internal_function
_dl_fini (void)
{
/* Lots of fun ahead. We have to call the destructors for all still
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 3c92a296cd..4540096688 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -968,7 +968,7 @@ extern void _dl_init (struct link_map *main_map, int argc, char **argv,
/* Call the finalizer functions of all shared objects whose
initializer functions have completed. */
-extern void _dl_fini (void) internal_function;
+extern void _dl_fini (void);
/* Sort array MAPS according to dependencies of the contained objects. */
extern void _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used,