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: x86 - linker optimization of "call *constant_variable" - feasible?


On Tue, Aug 12, 2003 at 10:39:17PM -0700, Zack Weinberg wrote:
> Ok, so, I'm not necessarily volunteering to implement this, but could
> you give me a rundown on how one adds a new reloc type

Hmm, probably the easiest way is to look at a patch that recently
added some new reloc types.  For example,
http://sources.redhat.com/ml/binutils/2003-07/msg00003.html

Add R_386_something to include/elf/i386.h
Add BFD_RELOC_something to bfd/reloc.c if no existing reloc will do.
Add reloc howto, and code to handle reloc in reloc_type_lookup and other
functions in bfd/elf32-i386.c.  Most places it should behave exactly as
R_386_32.
Generate the reloc in gas/config/tc-i386.c, most likely spot is fudging
reloc_type in output_disp as done for got relocs.

>, and what
> pitfalls one might encounter?  Are there backward compatibility
> concerns?

Objects generated by a new toolchain wouldn't be able to be linked by
older ld, or non-GNU ld.

-- 
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]