static int err;
static int dbgsyms = 1;
static int strip = 0;
-static char *mapname;
-static char *outname;
+static const char *mapname;
+static const char *outname;
static void error(const char *p)
{
free(o);
}
-struct symbol *new_symbol(char *name, int hash)
+struct symbol *new_symbol(const char *name, int hash)
{
struct symbol *s = xmalloc(sizeof(struct symbol));
strncpy(s->name, name, 16);
return s;
}
-struct symbol *find_symbol(char *name, int hash)
+struct symbol *find_symbol(const char *name, int hash)
{
struct symbol *s = symhash[hash];
while (s) {
/* Check if a symbol name is known but undefined. We use this to decide
whether to incorporate a library module */
-int is_undefined(char *name)
+static int is_undefined(const char *name)
{
int hash = hash_symbol(name);
struct symbol *s = find_symbol(name, hash);
return 1;
}
-struct symbol *find_alloc_symbol(struct object *o, uint8_t type, char *id, uint16_t value)
+static struct symbol *find_alloc_symbol(struct object *o, uint8_t type, const char *id, uint16_t value)
{
uint8_t hash = hash_symbol(id);
struct symbol *s = find_symbol(id, hash);
return s;
}
-static void insert_internal_symbol(char *name, int seg, uint16_t val)
+static void insert_internal_symbol(const char *name, int seg, uint16_t val)
{
find_alloc_symbol(NULL, seg | S_PUBLIC, name, val);
}
* LD_RELOC: a relocation stream is output with no remaining symbol relocations
* and all internal relocations resolved.
*/
-void relocate_stream(struct object *o, FILE * op, FILE * ip)
+static void relocate_stream(struct object *o, FILE * op, FILE * ip)
{
int c;
uint8_t size;
error("corrupt reloc stream");
}
-FILE *openobject(struct object *o)
+static FILE *openobject(struct object *o)
{
FILE *fp = xfopen(o->path, "r");
xfseek(fp, o->off);
return fp;
}
-void write_stream(FILE * op, int seg)
+static void write_stream(FILE * op, int seg)
{
struct object *o = objects;
}
}
-void write_binary(FILE * op, FILE *mp)
+static void write_binary(FILE * op, FILE *mp)
{
static struct objhdr hdr;
hdr.o_arch = arch;
int main(int argc, char *argv[])
{
int opt;
- FILE *bp, *mp;
+ FILE *bp, *mp = NULL;
arg0 = argv[0];