[patch] Handle multiple ELF function types.

Paul Brook paul@codesourcery.com
Tue Apr 3 22:34:00 GMT 2007


The attached patch addresses the issue raised in
http://sourceware.org/ml/binutils/2007-01/msg00257.html

ARM has multiple ELF functions types[1] (STT_FUNC and STT_ARM_TFUNC). For most 
purposes these are the same, the differences are in the exact value used when 
resolving relocations against these symbols.

In elflink.c there are several places that want to know if something is a 
function symbol, as this influences behavior when there are multiple 
definitions of a symbol.

The patch adds a new ELF backend hook and uses this instead of explicitly 
comparing against STT_FUNC.

It also suppresses the diagnostic about mismatching symbol types when both are 
function types. For full generality this should probably be another hook, but 
ARM is the only target with multiple function types, and it doesn't care.

Tested on arm-none-eabi, arm-linux-gnueabi and i686-pc-linux-gnu.
Ok?

Paul

[1] STT_ARM_TFUC has been removed from recent ARM ELF specifications in favour 
of encoding this information in the symbol value.  However BFD still uses the 
old representation internally.

2007-04-03  Paul Brook  <paul@codesourcery.com>

	bfd/
	* elf.c (_bfd_elf_is_function_type): New function.
	* elflink.c (_bfd_elf_merge_symbol): Use bed->is_function_type.
	(_bfd_elf_dynamic_symbol_p, _bfd_elf_symbol_refs_local_p,
	is_global_data_symbol_definition, elf_link_add_object_symbols): Ditto.
	* elf-bfd.h (elf_backend_data): Add is_function_type.
	(_bfd_elf_is_function_type): Add prototype.
	* elfxx-target.h (elf_backend_is_function_type): Add default
	definition.
	(elfNN_bed): Add elf_backend_is_function_type.
	* elf32-arm.c (elf32_arm_is_function_type): New function.
	(elf_backend_is_function_type): Define.

	ld/testsuite/
	* ld-arm/preempt-app.s: New test.
	* ld-arm/preempt-app.sym: New.
	* ld-arm/arm-elf.exp: Add preempt-app.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.preempt_thumb_fsf
Type: text/x-diff
Size: 13432 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20070403/031396cf/attachment.bin>


More information about the Binutils mailing list