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: Proposal to change tc_fix_adjustable API


Hi Alan,

>However, I suspect that you really need to fix bugs in the ip2k linker
relaxation code, rather than just try to avoid them.

I couldn't agree more, and I just found and fixed the problem.

The proposed changed to the fix adjustable API can be ignored.

The attached patch fixes the linker relocation adjustment and includes the
linker relaxation rewrite which I submitted about a week ago and did not get
any response to (this is a critical patch as the old code was very broken).

This linker patch can handle any sect+offs format relocation in the same
section as well as any symbol (with or without offset) that points to the
current or different section. The key was fixing it so that it makes an
offset adjustment if you are deleting an instruction in-between the
reference point and the ref+offset.

My previous patch to gas is correct and should be applied. If a relocation
is local then it has to be resolved by the assembler to a sect+offs
relocation otherwise gdb gets really confused. If it is a function call then
it isn't local and the linker will resolve the symbol. The importiant thing
is that gas does not produce sect+offs relocations for a relocation to a
different section that can be relaxed as the relax code does not have
visibility to fix sect+offs relocations across sections.

I have tested the two patches (ld/bfd and gas) against our complete test
suite and it works.

Thanks for all your advice.

BTW - Who should I pester to get these patches reviewed and applied?

Thanks

Nick

----- Original Message -----
From: "Alan Modra" <amodra@bigpond.net.au>
To: <jafa@silicondust.com>
Sent: Thursday, December 19, 2002 6:37 PM
Subject: Re: Proposal to change tc_fix_adjustable API


*This message was transferred with a trial version of CommuniGate(tm) Pro*
On Thu, Dec 19, 2002 at 04:16:10PM -0800, Nick Kelsey wrote:
> I would like to add a new paramter to the tc_fix_adjustable API:

That could be done easily enough since tc_fix_adjustable is a macro.
In fact, we may as well pass the symbol section as well, so in your
case

#define tc_fix_adjustable(FIX, SEC, SYMSEC) \
  ip2k_fix_adjustable (FIX, SEC, SYMSEC)

and on other targets

#define tc_fix_adjustable(FIX, SEC, SYMSEC) \
  xxx_fix_adjustable (FIX)

However, I suspect that you really need to fix bugs in the ip2k linker
relaxation code, rather than just try to avoid them.  You seem to have
found that symbols in a relaxed code section lead to gdb problems, yet
I see code in elf32-ip2k.c that is attempting to adjust symbols.  Why
isn't this working?

--
Alan Modra
IBM OzLabs - Linux Technology Centre

Attachment: elf32-ip2k.patch
Description: Binary data

Attachment: ChangeLog
Description: Binary data


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