home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / cctools / as / fixes.c < prev    next >
C/C++ Source or Header  |  1993-10-07  |  2KB  |  58 lines

  1. /* fixes.h (was taken from write.c in the original GAS)
  2.    Copyright (C) 1986,1987 Free Software Foundation, Inc.
  3.  
  4. This file is part of GAS, the GNU Assembler.
  5.  
  6. GAS is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 1, or (at your option)
  9. any later version.
  10.  
  11. GAS is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GAS; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #include "sections.h"
  21. #include "obstack.h"
  22. #include "frags.h"
  23. #include "fixes.h"
  24. #include "symbols.h"
  25.  
  26. /*
  27.  * fix_new() creates a fixS in obstack 'notes'.
  28.  */
  29. void
  30. fix_new(
  31. fragS    *frag,        /* which frag? */
  32. int    where,        /* where in that frag? */
  33. int    size,        /* 1, 2 or 4 bytes */
  34. symbolS *add_symbol,    /* X_add_symbol */
  35. symbolS *sub_symbol,    /* X_subtract_symbol */
  36. long    offset,        /* X_add_number */
  37. int    pcrel,        /* TRUE if PC-relative relocation */
  38. int    pcrel_reloc,    /* TRUE if must have relocation entry */
  39. int    r_type)        /* relocation type */
  40. {
  41.     struct fix *fixP;
  42.  
  43.     fixP = (struct fix *)obstack_alloc(¬es, sizeof(struct fix));
  44.  
  45.     fixP->fx_frag         = frag;
  46.     fixP->fx_where       = where;
  47.     fixP->fx_size         = size;
  48.     fixP->fx_addsy       = add_symbol;
  49.     fixP->fx_subsy       = sub_symbol;
  50.     fixP->fx_offset      = offset;
  51.     fixP->fx_pcrel       = pcrel;
  52.     fixP->fx_pcrel_reloc = pcrel_reloc;
  53.     fixP->fx_r_type      = r_type;
  54.  
  55.     fixP->fx_next              = frchain_now->frch_fix_root;
  56.     frchain_now->frch_fix_root = fixP;
  57. }
  58.