This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Ok to change so a target can define RELOC_..._BITS_...?
- To: binutils at sourceware dot cygnus dot com
- Subject: Ok to change so a target can define RELOC_..._BITS_...?
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Date: Mon, 6 Mar 2000 17:40:50 +0100
The file include/aout/aout64.h defines a bunch of reloc-layout
macros, RELOC_x_BITS_y_... like RELOC_EXT_BITS_TYPE_LITTLE,
including STD and BIG equivalents.
The to-be-submitted CRIS port (a little-endian target) uses
external relocs, but unfortunately needs definitions of these
macros that do not match the default.
Some of the users of these macros, all of which are in aoutx.h,
are functions that can not be overridden with a target-specific
one without effort or duplicating lots of code,
e.g. aout_link_input_section_ext.
I'd like to submit a patch to include/aout/aout64.h that
conditionalizes these macro settings, so a target can define
them before including e.g. aout32.h. It seems all users are
static functions, so a multi-target BFD should not break.
I know it looks like there are issues with duplicate
definitions of these macros in aout_gnu.h, but that file is not
included (from the only includer obj-aout.h) when the target
defines BFD_ASSEMBLER.
Anyway, before I cook up patches, I'd like to make sure there's
consensus that this is the right way to generalize the target
reloc-layout. There might be related issues; I'm trying to
separate what I can.
FWIW, this works for me for a single-target bfd in 2.9.1 but
I also know that's not a valid argument. :-)
Patch snippet:
Index: aout64.h
===================================================================
RCS file: /cvs/src/src/include/aout/aout64.h,v
retrieving revision 1.2
diff -c -p -r1.2 aout64.h
*** aout64.h 1999/07/12 11:12:37 1.2
--- aout64.h 2000/03/06 15:45:03
*************** struct reloc_ext_external {
*** 388,394 ****
--- 388,397 ----
bfd_byte r_addend[BYTES_IN_WORD]; /* datum addend */
};
+ #ifndef RELOC_EXT_BITS_EXTERN_BIG
#define RELOC_EXT_BITS_EXTERN_BIG ((unsigned int) 0x80)
+ #endif
+
#define RELOC_EXT_BITS_EXTERN_LITTLE ((unsigned int) 0x01)
#define RELOC_EXT_BITS_TYPE_BIG ((unsigned int) 0x1F)
brgds, H-P