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]

[PATCH]: Linker trampoline generation for HC11/HC12


Hi!

This patch adds a new file to support linker trampoline generation for HC11 and HC12.
When the address of a far function is taken, the linker must use the address of
a trampoline instead of the address of the function.  The reason is that when such
function is called, we will use a normal 'jsr' which does not handle memory
bank switching.  The trampoline code will take care of:

  - saving the current memory page on stack,
  - jumping to the real function

(in other word transform the 'jsr' call frame into a 'call' call frame).

I took the hppaelf.em file and hack it to the extreme to:
  - gather the list of trampolines to generate before allocation,
  - generate the trampolines after garbage collection and linker
    relaxation (I need the final address of functions and these can
    change after relax).

Committed but not yet used (it needs the bfd part).

Stephane

2003-04-19 Stephane Carrez <stcarrez at nerim dot fr>

	* emultempl/m68hc1xelf.em: New file to generate far trampolines on
	68HC11 and 68HC12.
	(LDEMUL_BEFORE_ALLOCATION): Override to gather the trampolines to
	generate.
	(LDEMUL_FINISH): Override to generate the trampolines after gc and
	linker relaxation.
	(LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Override to create the
	stub file for trampolines.
	(PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_LONGOPTS): New options
	--no-trampoline and --bank-window to control the memory bank window.


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