2002-06-07 17:29:30 +00:00
|
|
|
/*
|
|
|
|
reloc.h
|
|
|
|
|
2002-10-22 14:53:18 +00:00
|
|
|
relocation support
|
2002-06-07 17:29:30 +00:00
|
|
|
|
2002-10-22 14:53:18 +00:00
|
|
|
Copyright (C) 2002 Bill Currie <bill@taniwha.org>
|
2002-06-07 17:29:30 +00:00
|
|
|
|
2002-10-22 14:53:18 +00:00
|
|
|
Author: Bill Currie <bill@taniwha.org>
|
|
|
|
Date: 2002/06/07
|
2002-06-07 17:29:30 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
$Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __reloc_h
|
|
|
|
#define __reloc_h
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
rel_none,
|
|
|
|
rel_op_a_def,
|
|
|
|
rel_op_b_def,
|
|
|
|
rel_op_c_def,
|
|
|
|
rel_op_a_op,
|
|
|
|
rel_op_b_op,
|
|
|
|
rel_op_c_op,
|
|
|
|
rel_def_op,
|
|
|
|
rel_def_def,
|
2002-06-21 20:46:56 +00:00
|
|
|
rel_def_func,
|
2002-07-11 17:06:15 +00:00
|
|
|
rel_def_string,
|
2002-07-16 21:59:47 +00:00
|
|
|
rel_def_field,
|
2003-08-21 02:21:30 +00:00
|
|
|
rel_op_a_def_ofs,
|
|
|
|
rel_op_b_def_ofs,
|
|
|
|
rel_op_c_def_ofs,
|
|
|
|
rel_def_def_ofs,
|
2004-11-12 10:49:00 +00:00
|
|
|
rel_def_field_ofs,
|
2002-06-07 17:29:30 +00:00
|
|
|
} reloc_type;
|
|
|
|
|
|
|
|
typedef struct reloc_s {
|
|
|
|
struct reloc_s *next;
|
2003-08-22 19:48:14 +00:00
|
|
|
struct ex_label_s *label;
|
2002-06-07 17:29:30 +00:00
|
|
|
int ofs;
|
|
|
|
reloc_type type;
|
2003-07-24 17:51:24 +00:00
|
|
|
int line;
|
|
|
|
string_t file;
|
2002-06-07 17:29:30 +00:00
|
|
|
} reloc_t;
|
|
|
|
|
|
|
|
struct statement_s;
|
2004-01-30 07:16:48 +00:00
|
|
|
struct def_s;
|
|
|
|
struct function_s;
|
2002-06-07 17:29:30 +00:00
|
|
|
|
|
|
|
reloc_t *new_reloc (int ofs, reloc_type type);
|
|
|
|
void relocate_refs (reloc_t *refs, int ofs);
|
2003-08-21 02:21:30 +00:00
|
|
|
void reloc_op_def (struct def_s *def, int ofs, int field);
|
|
|
|
void reloc_op_def_ofs (struct def_s *def, int ofs, int field);
|
2002-07-13 06:09:03 +00:00
|
|
|
void reloc_def_def (struct def_s *def, int ofs);
|
2003-08-21 02:21:30 +00:00
|
|
|
void reloc_def_def_ofs (struct def_s *def, int ofs);
|
2002-07-13 06:09:03 +00:00
|
|
|
void reloc_def_func (struct function_s *func, int ofs);
|
|
|
|
void reloc_def_string (int ofs);
|
2002-07-16 21:59:47 +00:00
|
|
|
void reloc_def_field (struct def_s *def, int ofs);
|
2004-11-12 10:49:00 +00:00
|
|
|
void reloc_def_field_ofs (struct def_s *def, int ofs);
|
2003-08-22 19:48:14 +00:00
|
|
|
void reloc_def_op (struct ex_label_s *label, int ofs);
|
2002-06-07 17:29:30 +00:00
|
|
|
|
|
|
|
#endif//__reloc_h
|