This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: BZ/175: Fix dynamic string offset


On Fri, May 28, 2004 at 01:11:55PM -0700, Jim Wilson wrote:
> On Fri, 2004-05-28 at 08:59, H. J. Lu wrote:
> > 	* elfxx-ia64.c (elfNN_ia64_relax_section): Properly call
> > 	_bfd_merged_section_offset for local symbols.
> 
> Alan suggested asking me, but this is an area of binutils that I don't
> understand well.  Richard did most of the IA-64 bfd work.

Well, the particular part that I wanted you to comment on related to
ia64 relocations.  The string merge code attempts to translate the
address of a SEC_MERGE access pre-merge into an address post-merge.
The problem HJ was trying to fix at the time required the addend to be
ignored on a relocation for a particular code sequence.  See
http://sources.redhat.com/ml/binutils/2004-05/msg00391.html.  I feel
that that particular patch was likely to fix one case, and break others,
and in any case couldn't be right because relocate_section would need to
ignore the addend on the same code sequence.  It appears a difficult
problem to fix, as the linker really needs to infer values in
registers.

> I do see however that this patch makes the bfd_merged_section_offset
> support in elfNN_ia64_relax_section work more like the support in
> elfNN_ia64_relocate_section, and on that basis, it does appear correct

That isn't necessarily so..  The merge code is rather complicated,
perhaps more so than it needs be.  Local and global symbols in SEC_MERGE
sections are adjusted before relocate_section is called.  The only ones
that _aren't_ adjusted are section symbols, hence the need to adjust
them in relocate_section.  During relaxation, no SEC_MERGE symbol has
been adjusted, so I think all SEC_MERGE symbols should be adjusted in
relax_section.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]