public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch] gnu_indirect_function support for FreeBSD
@ 2011-12-12 20:25 Andreas Tobler
  2011-12-13 13:04 ` nick clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Tobler @ 2011-12-12 20:25 UTC (permalink / raw)
  To: binutils; +Cc: Konstantin Belousov

Hi all,

as of today FreeBSD supports the gnu_indirect_function elf_type:

http://lists.freebsd.org/pipermail/svn-src-head/2011-December/032133.html

Therefor we'd like to 'enable' this functionality in gas and readelf.
Below the patch which I have tested on x86_64/amd64-*-freebsd10.0.
There are some modifications necessary in the ld-ifunc test cases. 
Namely the matching of the osabi string. This will be a separate patch.

Is the below ok for trunk?

TIA,
Andreas

2011-12-12  Andreas Tobler  <andreast@fgznet.ch>

	* readelf.c (get_symbol_type): Add ELFOSABI_FREEBSD to the
	supported abi's.

2011-12-12  Konstantin Belousov  <kib@FreeBSD.org>

	* config/obj-elf.c (obj_elf_type): Add ELFOSABI_FREEBSD to the
	supported abi's.

Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.560
diff -u -r1.560 readelf.c
--- binutils/readelf.c	2 Nov 2011 03:09:01 -0000	1.560
+++ binutils/readelf.c	12 Dec 2011 20:10:41 -0000
@@ -8680,7 +8680,8 @@
  	  if (type == STT_GNU_IFUNC
  	      && (elf_header.e_ident[EI_OSABI] == ELFOSABI_GNU
  		  /* GNU is still using the default value 0.  */
-		  || elf_header.e_ident[EI_OSABI] == ELFOSABI_NONE))
+		  || elf_header.e_ident[EI_OSABI] == ELFOSABI_NONE
+		  || elf_header.e_ident[EI_OSABI] == ELFOSABI_FREEBSD))
  	    return "IFUNC";

  	  snprintf (buff, sizeof (buff), _("<OS specific>: %d"), type);
Index: gas/config/obj-elf.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.c,v
retrieving revision 1.143
diff -u -r1.143 obj-elf.c
--- gas/config/obj-elf.c	4 Aug 2011 07:44:44 -0000	1.143
+++ gas/config/obj-elf.c	12 Dec 2011 20:10:41 -0000
@@ -1703,8 +1703,9 @@
        bed = get_elf_backend_data (stdoutput);
        if (!(bed->elf_osabi == ELFOSABI_GNU
  	    /* GNU is still using the default value 0.  */
-	    || bed->elf_osabi == ELFOSABI_NONE))
-	as_bad (_("symbol type \"%s\" is supported only by GNU targets"),
+	    || bed->elf_osabi == ELFOSABI_NONE
+	    || bed->elf_osabi == ELFOSABI_FREEBSD))
+	as_bad (_("symbol type \"%s\" is supported only by GNU and FreeBSD 
targets"),
  		type_name);
        type = BSF_FUNCTION | BSF_GNU_INDIRECT_FUNCTION;
      }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] gnu_indirect_function support for FreeBSD
  2011-12-12 20:25 [patch] gnu_indirect_function support for FreeBSD Andreas Tobler
@ 2011-12-13 13:04 ` nick clifton
  2011-12-13 16:15   ` Andreas Tobler
  0 siblings, 1 reply; 4+ messages in thread
From: nick clifton @ 2011-12-13 13:04 UTC (permalink / raw)
  To: Andreas Tobler; +Cc: binutils, Konstantin Belousov

Hi   Andreas,

> 2011-12-12 Andreas Tobler <andreast@fgznet.ch>
>
> * readelf.c (get_symbol_type): Add ELFOSABI_FREEBSD to the
> supported abi's.
>
> 2011-12-12 Konstantin Belousov <kib@FreeBSD.org>
>
> * config/obj-elf.c (obj_elf_type): Add ELFOSABI_FREEBSD to the
> supported abi's.

Approved - please apply.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] gnu_indirect_function support for FreeBSD
  2011-12-13 13:04 ` nick clifton
@ 2011-12-13 16:15   ` Andreas Tobler
  2011-12-13 16:44     ` nick clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Tobler @ 2011-12-13 16:15 UTC (permalink / raw)
  To: nick clifton; +Cc: binutils, Konstantin Belousov

Hi Nick,

On 13.12.11 14:02, nick clifton wrote:

>> 2011-12-12 Andreas Tobler<andreast@fgznet.ch>
>>
>> * readelf.c (get_symbol_type): Add ELFOSABI_FREEBSD to the
>> supported abi's.
>>
>> 2011-12-12 Konstantin Belousov<kib@FreeBSD.org>
>>
>> * config/obj-elf.c (obj_elf_type): Add ELFOSABI_FREEBSD to the
>> supported abi's.
>
> Approved - please apply.

Thank you very much.

My assignment request went out yesterday.

I already have gcc and gdb WAA access and I'm able to check out binutils 
as user (the same as for gcc/gdb). I think technically I should be able 
to ci.

Am I already allowed to ci myself?

Thanks,
Andreas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] gnu_indirect_function support for FreeBSD
  2011-12-13 16:15   ` Andreas Tobler
@ 2011-12-13 16:44     ` nick clifton
  0 siblings, 0 replies; 4+ messages in thread
From: nick clifton @ 2011-12-13 16:44 UTC (permalink / raw)
  To: Andreas Tobler; +Cc: binutils, Konstantin Belousov

Hi Andreas,

>>> 2011-12-12 Andreas Tobler<andreast@fgznet.ch>
>>>
>>> * readelf.c (get_symbol_type): Add ELFOSABI_FREEBSD to the
>>> supported abi's.

> My assignment request went out yesterday.
>
> I already have gcc and gdb WAA access and I'm able to check out binutils
> as user (the same as for gcc/gdb). I think technically I should be able
> to ci.
>
> Am I already allowed to ci myself?

It would be best to wait until the assignment request has been 
processed.  If you want the patch in before then, just let me know and I 
will check it in myself.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-13 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-12 20:25 [patch] gnu_indirect_function support for FreeBSD Andreas Tobler
2011-12-13 13:04 ` nick clifton
2011-12-13 16:15   ` Andreas Tobler
2011-12-13 16:44     ` nick clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).