This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
[PATCH] Added BFD/COFF hooks
- To: binutils at sourceware dot cygnus dot com
- Subject: [PATCH] Added BFD/COFF hooks
- From: Timothy Wall <twall at alum dot mit dot edu>
- Date: Wed, 09 Feb 2000 09:26:16 -0500
- CC: nickc at cygnus dot com
This patch adds a few hooks to BFD.
* bfd/coffcode.h (coff_write_relocs): Add predicate macro to detect if a
symbol should be treated as a relative relocation and have its index set
to "-1"
* bfd/coffswap.h (coff_swap_sym_in/out): Added
COFF_ADJUST_SYM_IN/OUT_POST to allow final adjustments to the symbol
being swapped.
Index: coffcode.h
===================================================================
RCS file: /cvs/src/src/bfd/coffcode.h,v
retrieving revision 1.28
diff -d -c -p -r1.28 coffcode.h
*** coffcode.h 2000/01/24 19:38:04 1.28
--- coffcode.h 2000/02/09 14:26:05
*************** coff_write_relocs (abfd, first_undef)
*** 2268,2274 ****
--- 2268,2278 ----
#endif
if (q->sym_ptr_ptr)
{
+ #ifdef SECTION_RELATIVE_ABSOLUTE_SYMBOL_P
+ if (SECTION_RELATIVE_ABSOLUTE_SYMBOL_P (q,s))
+ #else
if (q->sym_ptr_ptr == bfd_abs_section_ptr->symbol_ptr_ptr)
+ #endif
/* This is a relocation relative to the absolute symbol. */
n.r_symndx = -1;
else
Index: coffswap.h
===================================================================
RCS file: /cvs/src/src/bfd/coffswap.h,v
retrieving revision 1.5
diff -d -c -p -r1.5 coffswap.h
*** coffswap.h 2000/01/13 23:55:21 1.5
--- coffswap.h 2000/02/09 14:26:05
*************** coff_swap_sym_in (abfd, ext1, in1)
*** 357,362 ****
--- 357,365 ----
}
in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass);
in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux);
+ #ifdef COFF_ADJUST_SYM_IN_POST
+ COFF_ADJUST_SYM_IN_POST (abfd, ext1, in1);
+ #endif
}
static unsigned int
*************** coff_swap_sym_out (abfd, inp, extp)
*** 390,395 ****
--- 393,401 ----
}
bfd_h_put_8(abfd, in->n_sclass , ext->e_sclass);
bfd_h_put_8(abfd, in->n_numaux , ext->e_numaux);
+ #ifdef COFF_ADJUST_SYM_OUT_POST
+ COFF_ADJUST_SYM_OUT_POST (abfd, inp, extp);
+ #endif
return SYMESZ;
}