bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/22967] nm should distinguish in between local and global i


From: mliska at suse dot cz
Subject: [Bug binutils/22967] nm should distinguish in between local and global ifunc
Date: Wed, 14 Mar 2018 13:05:17 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=22967

--- Comment #2 from Martin Liska <mliska at suse dot cz> ---
(In reply to Nick Clifton from comment #1)
> Hi Martin,
> 
> > nm uses 'i' letter for GNU IFUNC symbols and it would be good to use
> > different letters for local and global ones. Similar what's done with 't'
> > and 'T'
> 
> Would you mind uploading an object file/executable containing both types
> of ifunc ?  Then I can see about fixing nm.  (Yes, I could create one myself
> but I am lazy^H^H^H^H busy).
> 
> Cheers
>   Nick

Sure, there's one static (local):

$ cat /tmp/ifunc.c 
static volatile int a;
static int my_foo1 (void) { return 1; }
static int my_foo2 (void) { return 2; }
typedef int (*F) (void);
static F resolve_foo (void) { if (a) return my_foo1; else return my_foo2; }
static int foo (void) __attribute__ ((ifunc ("resolve_foo")));

int
main ()
{
  if (foo () != 2)
    __builtin_abort ();
}

Commenting static before 'int foo' you get a global one.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]