This is the mail archive of the binutils@sourceware.cygnus.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]

alpha patch 1 of 2


I'm adding explicit relocation support for the Alpha for a contract
(where you use !literal!<sequence> for pointer loads, and
!lituse_base!<sequence> for each memory reference that uses the
address, which gets turned into LITERAL and LITUSE relocations, which
in turn can be optimized by the linker if -relax is used), and checked
in the following patch against BFD to add new relocation codes for the
assembler to use:

1999-11-27  Michael Meissner  <meissner@cygnus.com>

	* reloc.c (BFD_RELOC_ALPHA_USER_LITERAL): New relocation for
	internal use within gas for alpha explicit relocations.
	(BFD_RELOC_ALPHA_USER_LITUSE_BASE): Ditto.
	(BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF): Ditto.
	(BFD_RELOC_ALPHA_USER_LITUSE_JSR): Ditto.
	(BFD_RELOC_ALPHA_USER_GPDISP): Ditto.
	(BFD_RELOC_ALPHA_USER_GPRELHIGH): Ditto.
	(BFD_RELOC_ALPHA_USER_GPRELLOW): Ditto.

	* elf64-alpha.c (elf64_alpha_reloc_map): Add mappings for
	BFD_RELOC_ALPHA_USER_*.

	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

*** bfd/reloc.c.~1~	Sat Sep  4 13:07:46 1999
--- bfd/reloc.c	Sat Nov 27 22:18:39 1999
*************** ENUMDOC
*** 1961,1966 ****
--- 1961,1985 ----
       The GNU linker currently doesn't do any of this optimizing.
  
  ENUM
+   BFD_RELOC_ALPHA_USER_LITERAL
+ ENUMX
+   BFD_RELOC_ALPHA_USER_LITUSE_BASE
+ ENUMX
+   BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF
+ ENUMX
+   BFD_RELOC_ALPHA_USER_LITUSE_JSR
+ ENUMX
+   BFD_RELOC_ALPHA_USER_GPDISP
+ ENUMX
+   BFD_RELOC_ALPHA_USER_GPRELHIGH
+ ENUMX
+   BFD_RELOC_ALPHA_USER_GPRELLOW
+ ENUMDOC
+   The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to
+      process the explicit !<reloc>!sequence relocations, and are mapped
+      into the normal relocations at the end of processing.
+ 
+ ENUM
    BFD_RELOC_ALPHA_HINT
  ENUMDOC
    The HINT relocation indicates a value that should be filled into the
*** bfd/elf64-alpha.c.~1~	Sat Nov 27 22:10:20 1999
--- bfd/elf64-alpha.c	Sat Nov 27 22:18:39 1999
*************** static const struct elf_reloc_map elf64_
*** 972,977 ****
--- 972,988 ----
    {BFD_RELOC_16_PCREL,		R_ALPHA_SREL16},
    {BFD_RELOC_32_PCREL,		R_ALPHA_SREL32},
    {BFD_RELOC_64_PCREL,		R_ALPHA_SREL64},
+ 
+ /* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to process
+    the explicit !<reloc>!sequence relocations, and are mapped into the normal
+    relocations at the end of processing. */
+   {BFD_RELOC_ALPHA_USER_LITERAL,	R_ALPHA_LITERAL},
+   {BFD_RELOC_ALPHA_USER_LITUSE_BASE,	R_ALPHA_LITUSE},
+   {BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF,	R_ALPHA_LITUSE},
+   {BFD_RELOC_ALPHA_USER_LITUSE_JSR,	R_ALPHA_LITUSE},
+   {BFD_RELOC_ALPHA_USER_GPDISP,		R_ALPHA_GPDISP},
+   {BFD_RELOC_ALPHA_USER_GPRELHIGH,	R_ALPHA_GPRELHIGH},
+   {BFD_RELOC_ALPHA_USER_GPRELLOW,	R_ALPHA_GPRELLOW},
  };
  
  /* Given a BFD reloc type, return a HOWTO structure.  */
*** bfd/bfd-in2.h.~1~	Sat Nov 27 22:20:36 1999
--- bfd/bfd-in2.h	Sat Nov 27 22:21:04 1999
*************** The GNU linker currently doesn't do any 
*** 1830,1835 ****
--- 1830,1846 ----
    BFD_RELOC_ALPHA_ELF_LITERAL,
    BFD_RELOC_ALPHA_LITUSE,
  
+ /* The BFD_RELOC_ALPHA_USER_* relocations are used by the assembler to
+ process the explicit !<reloc>!sequence relocations, and are mapped
+ into the normal relocations at the end of processing. */
+   BFD_RELOC_ALPHA_USER_LITERAL,
+   BFD_RELOC_ALPHA_USER_LITUSE_BASE,
+   BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF,
+   BFD_RELOC_ALPHA_USER_LITUSE_JSR,
+   BFD_RELOC_ALPHA_USER_GPDISP,
+   BFD_RELOC_ALPHA_USER_GPRELHIGH,
+   BFD_RELOC_ALPHA_USER_GPRELLOW,
+ 
  /* The HINT relocation indicates a value that should be filled into the
  "hint" field of a jmp/jsr/ret instruction, for possible branch-
  prediction logic which may be provided on some processors. */
*** bfd/libbfd.h.~1~	Sat Nov 27 22:24:01 1999
--- bfd/libbfd.h	Sat Nov 27 22:09:43 1999
*************** static const char *const bfd_reloc_code_
*** 676,681 ****
--- 676,688 ----
    "BFD_RELOC_ALPHA_LITERAL",
    "BFD_RELOC_ALPHA_ELF_LITERAL",
    "BFD_RELOC_ALPHA_LITUSE",
+   "BFD_RELOC_ALPHA_USER_LITERAL",
+   "BFD_RELOC_ALPHA_USER_LITUSE_BASE",
+   "BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF",
+   "BFD_RELOC_ALPHA_USER_LITUSE_JSR",
+   "BFD_RELOC_ALPHA_USER_GPDISP",
+   "BFD_RELOC_ALPHA_USER_GPRELHIGH",
+   "BFD_RELOC_ALPHA_USER_GPRELLOW",
    "BFD_RELOC_ALPHA_HINT",
    "BFD_RELOC_ALPHA_LINKAGE",
    "BFD_RELOC_ALPHA_CODEADDR",

-- 
Michael Meissner, Cygnus Solutions
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886
email: meissner@cygnus.com	phone: 978-486-9304	fax: 978-692-4482

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