[PATCH] Fixes for GNU ld on amd64 Solaris

Michael Wetherell mike.wetherell@ntlworld.com
Fri Jul 14 14:50:00 GMT 2006


On Wednesday 28 Jun 2006 12:32, Jakub Jelinek wrote:
> That's itself OK, this is all in OS range, but you really can't use
> OS specific SHT_* tags in generic code if they can have multiple
> meanings. You need to use switch on the ELF's OS.

Hi,

I thought I should read-up before trying again. It seems that 
unrecognised OS specific sections shouldn't cause an error unless 
SHF_OS_NONCONFORMING is in the flag bits:
http://www.caldera.com/developers/gabi/latest/ch4.sheader.html#linking_rules

The patch below does that and programs do link now (this other patch is 
need too http://sources.redhat.com/ml/binutils/2006-06/msg00431.html).

bfd/ChangeLog
2006-07-14  Michael Wetherell  <mike.wetherell@ntlworld.com>

	* elf.c (bfd_section_from_shdr): Reject unrecognised OS-specific
	sections only if the SHF_OS_NONCONFORMING flag is present.

ld/ChangeLog
2006-07-14  Michael Wetherell  <mike.wetherell@ntlworld.com>

	* emulparams/elf_x86_64.sh (LIBPATH_SUFFIX, ELF_INTERPRETER_NAME):
	Set for *-*-solaris2*.

There is a wider problem though. What you were saying about checking the 
ELF's OS before looking at the OS-specific tags also applies to the GNU 
tags. And the problem with doing that is that e_ident[EI_OSABI] isn't 
being set currently.

It seems that the original intention was that e_ident[EI_OSABI] would be 
set if any OS-specific extensions were present see:
http://www.cygwin.com/ml/binutils/2000-11/msg00383.html

Regards,
Mike

-------------- next part --------------
A non-text attachment was scrubbed...
Name: solaris-amd64-2.diff
Type: text/x-diff
Size: 2001 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20060714/5936f441/attachment.bin>


More information about the Binutils mailing list