Fix -Wundef warnings for SHARED
Commit Message
The definition of SHARED is tested with #ifdef pretty much everywhere
apart from these few places. The tlsdesc.c code seems to be copy and
pasted to a few architectures and there is one instance in the hppa
startup code.
ChangeLog:
2014-07-07 Will Newton <will.newton@linaro.org>
* sysdeps/aarch64/tlsdesc.c (_dl_unmap): Test SHARED with #ifdef.
* sysdeps/arm/tlsdesc.c (_dl_unmap): Likewise.
* sysdeps/i386/tlsdesc.c (_dl_unmap): Likewise.
* sysdeps/x86_64/tlsdesc.c (_dl_unmap): Likewise.
* sysdeps/hppa/start.S (_start): Likewise.
---
sysdeps/aarch64/tlsdesc.c | 2 +-
sysdeps/arm/tlsdesc.c | 2 +-
sysdeps/hppa/start.S | 2 +-
sysdeps/i386/tlsdesc.c | 2 +-
sysdeps/x86_64/tlsdesc.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
Comments
On Mon, Jul 07, 2014 at 03:20:32PM +0100, Will Newton wrote:
> The definition of SHARED is tested with #ifdef pretty much everywhere
> apart from these few places. The tlsdesc.c code seems to be copy and
> pasted to a few architectures and there is one instance in the hppa
> startup code.
The change looks OK to me. Technically since we control the value of
SHARED, so we could possibly always define it to either 1 or 0, but
that would be a fairly large project given the extent of its use. If
such an approach is desired, it should be added to the master TODO
list* for someone to work on if they want to.
Siddhesh
* I don't know how many people even look at the TODO list for stuff to
work on TBH.
>
> ChangeLog:
>
> 2014-07-07 Will Newton <will.newton@linaro.org>
>
> * sysdeps/aarch64/tlsdesc.c (_dl_unmap): Test SHARED with #ifdef.
> * sysdeps/arm/tlsdesc.c (_dl_unmap): Likewise.
> * sysdeps/i386/tlsdesc.c (_dl_unmap): Likewise.
> * sysdeps/x86_64/tlsdesc.c (_dl_unmap): Likewise.
> * sysdeps/hppa/start.S (_start): Likewise.
> ---
> sysdeps/aarch64/tlsdesc.c | 2 +-
> sysdeps/arm/tlsdesc.c | 2 +-
> sysdeps/hppa/start.S | 2 +-
> sysdeps/i386/tlsdesc.c | 2 +-
> sysdeps/x86_64/tlsdesc.c | 2 +-
> 5 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/sysdeps/aarch64/tlsdesc.c b/sysdeps/aarch64/tlsdesc.c
> index 1b41819..7e8cf65 100644
> --- a/sysdeps/aarch64/tlsdesc.c
> +++ b/sysdeps/aarch64/tlsdesc.c
> @@ -147,7 +147,7 @@ _dl_unmap (struct link_map *map)
> {
> _dl_unmap_segments (map);
>
> -#if SHARED
> +#ifdef SHARED
> if (map->l_mach.tlsdesc_table)
> htab_delete (map->l_mach.tlsdesc_table);
> #endif
> diff --git a/sysdeps/arm/tlsdesc.c b/sysdeps/arm/tlsdesc.c
> index e52034d..ad74a23 100644
> --- a/sysdeps/arm/tlsdesc.c
> +++ b/sysdeps/arm/tlsdesc.c
> @@ -149,7 +149,7 @@ _dl_unmap (struct link_map *map)
> {
> _dl_unmap_segments (map);
>
> -#if SHARED
> +#ifdef SHARED
> /* _dl_unmap is only called for dlopen()ed libraries, for which
> calling free() is safe, or before we've completed the initial
> relocation, in which case calling free() is probably pointless,
> diff --git a/sysdeps/hppa/start.S b/sysdeps/hppa/start.S
> index 0998270..7254a75 100644
> --- a/sysdeps/hppa/start.S
> +++ b/sysdeps/hppa/start.S
> @@ -93,7 +93,7 @@ _start:
> stw %r23, -56(%sp)
> /* Need to setup 1, 4, 5, and 7th arguments */
>
> -#if SHARED
> +#ifdef SHARED
> /* load main (1st argument) */
> addil LT'.Lpmain, %r19
> ldw RT'.Lpmain(%r1), %r26
> diff --git a/sysdeps/i386/tlsdesc.c b/sysdeps/i386/tlsdesc.c
> index ef4a1dd..19a8788 100644
> --- a/sysdeps/i386/tlsdesc.c
> +++ b/sysdeps/i386/tlsdesc.c
> @@ -261,7 +261,7 @@ _dl_unmap (struct link_map *map)
> {
> _dl_unmap_segments (map);
>
> -#if SHARED
> +#ifdef SHARED
> if (map->l_mach.tlsdesc_table)
> htab_delete (map->l_mach.tlsdesc_table);
> #endif
> diff --git a/sysdeps/x86_64/tlsdesc.c b/sysdeps/x86_64/tlsdesc.c
> index c1c5e03..451f7be 100644
> --- a/sysdeps/x86_64/tlsdesc.c
> +++ b/sysdeps/x86_64/tlsdesc.c
> @@ -139,7 +139,7 @@ _dl_unmap (struct link_map *map)
> {
> _dl_unmap_segments (map);
>
> -#if SHARED
> +#ifdef SHARED
> /* _dl_unmap is only called for dlopen()ed libraries, for which
> calling free() is safe, or before we've completed the initial
> relocation, in which case calling free() is probably pointless,
> --
> 1.9.3
>
@@ -147,7 +147,7 @@ _dl_unmap (struct link_map *map)
{
_dl_unmap_segments (map);
-#if SHARED
+#ifdef SHARED
if (map->l_mach.tlsdesc_table)
htab_delete (map->l_mach.tlsdesc_table);
#endif
@@ -149,7 +149,7 @@ _dl_unmap (struct link_map *map)
{
_dl_unmap_segments (map);
-#if SHARED
+#ifdef SHARED
/* _dl_unmap is only called for dlopen()ed libraries, for which
calling free() is safe, or before we've completed the initial
relocation, in which case calling free() is probably pointless,
@@ -93,7 +93,7 @@ _start:
stw %r23, -56(%sp)
/* Need to setup 1, 4, 5, and 7th arguments */
-#if SHARED
+#ifdef SHARED
/* load main (1st argument) */
addil LT'.Lpmain, %r19
ldw RT'.Lpmain(%r1), %r26
@@ -261,7 +261,7 @@ _dl_unmap (struct link_map *map)
{
_dl_unmap_segments (map);
-#if SHARED
+#ifdef SHARED
if (map->l_mach.tlsdesc_table)
htab_delete (map->l_mach.tlsdesc_table);
#endif
@@ -139,7 +139,7 @@ _dl_unmap (struct link_map *map)
{
_dl_unmap_segments (map);
-#if SHARED
+#ifdef SHARED
/* _dl_unmap is only called for dlopen()ed libraries, for which
calling free() is safe, or before we've completed the initial
relocation, in which case calling free() is probably pointless,