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

Nick Clifton <nickc at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #6 from Nick Clifton <nickc at redhat dot com> ---
Hi Rainer,

(In reply to Rainer Orth from comment #3)
> it didn't initially.  When checking a debug build of ld, I found that
> the hdr->sh_type == bed->obj_attrs_section_type condition still held.
> The attached revised patch fixes that.

Thanks.

I have decided to split the patch into two.  The changes to the bfd/ files
fix the actual bug, so they make one patch, and the changes to common.h are
a separate update so I have split them out.  I have also gone ahead and applied
the bfd/ fixes to the mainline and 2.45 branch.


> However, logically the condition is the wrong way around IMO: instead of
> checking !is_solaris, it should be something like is_gnu, i.e. check if
> the target supports the GNU OSABI.  Otherwise, whenever any OS adds a
> conflicting SHT_<OS>_* entry in the SHT_LOOS/SHT_HIOS range, things will
> be broken again.

I suspect that this will break lots of targets which use attributes but do
not set the OS to ELFOSABI_GNU.  But I could be wrong.  Please feel free to
submit a patch to make this change (to the mainline, lets leave the branch
as it is).

> Besides, ELF_TARGET_OS was only defined on Solaris/x86 so far.  The
> revised patch adds matching definitions for Solaris/SPARC.

Yes, that was my bad.  I just assumed that ELF_TARGET_OS was being set
correctly 
for all Solaris based targets.


> However, there are quite a number of regressions in the binutils
> testsuite:

I suspect/hope that these are due to an unrelated issue.

> I've not yet found what's wrong here, however it seems to be CTF related
> in some way:
> 
> exited abnormally with 1,
> output:/var/gcc/binutils/i386/obj/binutils-2.45-branch/ld/../binutils/
> objdump: error: ctf_arc_bufopen(): cannot open CTF
> /var/gcc/binutils/i386/obj/binutils-2.45-branch/ld/../binutils/objdump: CTF
> open failure: Buffer does not contain CTF data.
> /var/gcc/binutils/i386/obj/binutils-2.45-branch/ld/../binutils/objdump:
> tmpdir/dump: file format not recognized

Maybe the CTF code needs attributes in order to work properly ?  (Just
guessing).

> There's more, however:
> 
> * <sys/link.h> has quite a number of DT_SUNW_* and DF_SUNW_* defines.
> 
> * <sys/elf.h> has ET_SUNW_*, PT_SUNW_*, SHF_SUNW_*.
> 
> One may want to add (some of?) those, too, maybe into a separate
> include/elf/sun.h (or solaris.h).

Indeed.  I am going to upload a revised version of the second part of the patch
which not only includes updates to common.h but also additions of code to
readelf
to display all these Solaris specific values.  If you have the time would you
mind
taking a look over it, and maybe trying out the new readelf decoding ?  

I did consider using a separate header file, but we already have other OS
specific
information on common.h.  Plus the whole point of this update was to have the 
various OS specific values defined close to their generic counterparts so that 
when coders want to select new values, they can avoid ones that are already
taken.

Cheers
  Nick

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

Reply via email to