This is the mail archive of the binutils@sourceware.org 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] MN10300 linker relaxation extension.


Hi Guys,

  I am checking in the attached patch to extend the MN10300 target's
  linker relaxation code so that it can support expressions in the
  assembler source file that involve the difference between two
  symbols defined in the same section.

  This code was developed by Red Hat as part of contract to support
  the AM34 processor (and AM32 variant) so the patch also contains a
  few changes to support the am34-linux-gnu target.

  Tested by building both an mn10300-elf and an am33_2.0-linux-gnu
  toolchain.  (Note the new linker tests expose a couple of bugs in
  the current gcc port to the mn10300.  I will be contributing gcc
  patches shortly).

Cheers
  Nick

gas/ChangeLog
2007-10-19  Nick Clifton  <nickc@redhat.com>

	* expr.c (expr): Test md_allow_local_subtract (if defined) before
	allowing the evaluation of an expression involving two symbols
	defined in the same section.
	* doc/internals.texi (md_allow_local_subtract): Document the new
	macro.
	* config/tc-mn10300.h (md_allow_local_subtract): Define.
	(RELAX_EXPANSION_POSSIBLE): Define.
	(MAX_RELOC_EXPANSION): Define.
	(TC_FRAG_TYPE): Define.
	* config/tc-mn10300.c (md_assemble): Mark fragments as containing code.
	(tc_gen_reloc): Return an array of relocs.  If necessary generate
	two relocs to handle an expressions involving the difference of
	two symbols.
	(mn10300_fix_adjustable): Do not test TC_FORCE_RELOCATION_LOCAL
	when then fixup is not pc-relative.
	(mn10300_allow_local_subtract): New function.  Determine when it
	is safe to compute the difference between two symbols at assemble
	time.

gas/testsuite/ChangeLog
2007-10-19  Nick Clifton  <nickc@redhat.com>

	* gas/mn10300/basic.exp: Run pr997 test.
	* gas/mn10300/pr997.s: New test.
	* gas/mn10300/pr887.l: Expected output.

bfd/ChangeLog
2007-10-19  Nick Clifton  <nickc@redhat.com>

	* config.bfd: Recognise am34-linux-gnu target.
	* reloc.c: Add BFD_RELOC_MN10300_SYM_DIFF relocation.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
	* elf-m10300.c (elf_mn10300_howto): Add R_MN10300_SYM_DIFF.
	(mn10300_reloc_map): Likewise.
	(mn10300_elf_check_relocs): Do not create dynamic relocs for
	symbol differences or relocations against absolute symbols.
	(mn10300_elf_final_link_relocate): Likewise.
	Handle R_MN10300_SYM_DIFF relocs. 
	(mn10300_elf_relocate_section): Fix for creating local copys of
	dynamic relocs.
	(mn10300_elf_relax_delete_bytes): Adjust symbols at the end of the
	region.  Adjust the size of function symbols.
	(mn10300_elf_relax_section): Ignore symbols that are in discarded
	sections.

include/elf/ChangeLog
2007-10-19  Nick Clifton  <nickc@redhat.com>

	* mn10300.h: Add R_MN10300_SYM_DIFF reloc.

ld/ChangeLog
2007-10-19  Nick Clifton  <nickc@redhat.com>

	* configure.tgt: Add support for am34-linux-gnu target.

ld/testsuite/ChangeLog
2007-10-19  Nick Clifton  <nickc@redhat.com>

	* ld-mn10300: New test directory.
	* ld-mn10300/mn10300.exp: Run the new tests.
	* ld-mn10300/i112045-1.s: Linker relaxation test.
	* ld-mn10300/i112045-1.d: Expected disassembly.
	* ld-mn10300/i112045-2.s: Linker relaxation test.
	* ld-mn10300/i112045-2.d: Expected disassembly.
	* ld-mn10300/i126256-1.c: Test source.
	* ld-mn10300/i126256-2.c: Test source.
	* ld-mn10300/i135409.s: Linker relaxation test.
	* ld-mn10300/i135409.d: Expected symbol table contents.
	* ld-mn10300/i136434.s: Linker string section merge test.
	* ld-mn10300/i136434.d: Expected disassembly.
	* ld-mn10300/i136434-2.s: Test source file.

Attachment: mn10300.relax.patch.bz2
Description: BZip2 compressed data


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