aboutsummaryrefslogtreecommitdiff
path: root/bfd/reloc.c
diff options
context:
space:
mode:
authorSteve Chamberlain <steve@cygnus>1991-10-01 03:58:36 +0000
committerSteve Chamberlain <steve@cygnus>1991-10-01 03:58:36 +0000
commite5683622186b119b519c82bf58269dd5513e8e19 (patch)
tree6bedb0133b644213ae0cbb0c3d811b7a026337fb /bfd/reloc.c
parent11fdd520037afd34809e739714edd13e94f270e4 (diff)
downloadgdb-e5683622186b119b519c82bf58269dd5513e8e19.zip
gdb-e5683622186b119b519c82bf58269dd5513e8e19.tar.gz
gdb-e5683622186b119b519c82bf58269dd5513e8e19.tar.bz2
Added new macro NEWHOWTO
Diffstat (limited to 'bfd/reloc.c')
-rw-r--r--bfd/reloc.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 0e4edd0..e30f936 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -361,6 +361,34 @@ The HOWTO define is horrible and will go away.
{(unsigned)C,R,S,B, P, BI, ABS,O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
*-
+And will be replaced with the totally magic way. But for the moment,
+we are compatible, so do it this way..
+
+*+
+#define NEWHOWTO( FUNCTION, NAME,SIZE,REL) HOWTO(0,0,SIZE,0,REL,0,false,false,FUNCTION, NAME,false,0,0,false)
+*-
+
+Helper routine to turn a symbol into a relocation value.
+
+*+
+
+
+#define HOWTO_PREPARE(relocation, symbol) \
+ { \
+ if (symbol != (asymbol *)NULL) { \
+ if (symbol->flags & BSF_FORT_COMM) { \
+ relocation = 0; \
+ } \
+ else { \
+ relocation = symbol->value; \
+ } \
+ } \
+ if (symbol->section != (asection *)NULL) { \
+ relocation += symbol->section->output_section->vma + \
+ symbol->section->output_offset; \
+ } \
+}
+*-
*/
/*proto* reloc_chain