annotate src/lwlink.c @ 305:10cc87f4b16c

Added basic raw output module
author lost
date Thu, 22 Jan 2009 02:14:52 +0000
parents 48945dac8178
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
294
0f488febdc2b command line options
lost
parents:
diff changeset
1 /*
0f488febdc2b command line options
lost
parents:
diff changeset
2 lwlink.c
300
48945dac8178 Fixed copyright year
lost
parents: 299
diff changeset
3 Copyright © 2009 William Astle
294
0f488febdc2b command line options
lost
parents:
diff changeset
4
0f488febdc2b command line options
lost
parents:
diff changeset
5 This file is part of LWLINK.
0f488febdc2b command line options
lost
parents:
diff changeset
6
0f488febdc2b command line options
lost
parents:
diff changeset
7 LWLINK is free software: you can redistribute it and/or modify it under the
0f488febdc2b command line options
lost
parents:
diff changeset
8 terms of the GNU General Public License as published by the Free Software
0f488febdc2b command line options
lost
parents:
diff changeset
9 Foundation, either version 3 of the License, or (at your option) any later
0f488febdc2b command line options
lost
parents:
diff changeset
10 version.
0f488febdc2b command line options
lost
parents:
diff changeset
11
0f488febdc2b command line options
lost
parents:
diff changeset
12 This program is distributed in the hope that it will be useful, but WITHOUT
0f488febdc2b command line options
lost
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0f488febdc2b command line options
lost
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
0f488febdc2b command line options
lost
parents:
diff changeset
15 more details.
0f488febdc2b command line options
lost
parents:
diff changeset
16
0f488febdc2b command line options
lost
parents:
diff changeset
17 You should have received a copy of the GNU General Public License along with
0f488febdc2b command line options
lost
parents:
diff changeset
18 this program. If not, see <http://www.gnu.org/licenses/>.
0f488febdc2b command line options
lost
parents:
diff changeset
19
0f488febdc2b command line options
lost
parents:
diff changeset
20
0f488febdc2b command line options
lost
parents:
diff changeset
21
0f488febdc2b command line options
lost
parents:
diff changeset
22 */
0f488febdc2b command line options
lost
parents:
diff changeset
23
0f488febdc2b command line options
lost
parents:
diff changeset
24 #ifdef HAVE_CONFIG_H
0f488febdc2b command line options
lost
parents:
diff changeset
25 #include "config.h"
0f488febdc2b command line options
lost
parents:
diff changeset
26 #endif
0f488febdc2b command line options
lost
parents:
diff changeset
27
0f488febdc2b command line options
lost
parents:
diff changeset
28 #define __lwlink_c_seen__
0f488febdc2b command line options
lost
parents:
diff changeset
29
0f488febdc2b command line options
lost
parents:
diff changeset
30 #include <argp.h>
0f488febdc2b command line options
lost
parents:
diff changeset
31 #include <errno.h>
0f488febdc2b command line options
lost
parents:
diff changeset
32 #include <stdio.h>
0f488febdc2b command line options
lost
parents:
diff changeset
33 #include <stdlib.h>
0f488febdc2b command line options
lost
parents:
diff changeset
34
0f488febdc2b command line options
lost
parents:
diff changeset
35 #include "lwlink.h"
296
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents: 294
diff changeset
36 #include "util.h"
294
0f488febdc2b command line options
lost
parents:
diff changeset
37
0f488febdc2b command line options
lost
parents:
diff changeset
38 int debug_level = 0;
0f488febdc2b command line options
lost
parents:
diff changeset
39 int outformat = OUTPUT_DECB;
0f488febdc2b command line options
lost
parents:
diff changeset
40 char *outfile = NULL;
299
460d96987670 parse linking scripts
lost
parents: 297
diff changeset
41 char *scriptfile = NULL;
294
0f488febdc2b command line options
lost
parents:
diff changeset
42
297
c52ad3135bd3 implement reading files
lost
parents: 296
diff changeset
43 fileinfo_t **inputfiles = NULL;
296
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents: 294
diff changeset
44 int ninputfiles = 0;
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents: 294
diff changeset
45
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents: 294
diff changeset
46 void add_input_file(char *fn)
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents: 294
diff changeset
47 {
297
c52ad3135bd3 implement reading files
lost
parents: 296
diff changeset
48 inputfiles = lw_realloc(inputfiles, sizeof(fileinfo_t *) * (ninputfiles + 1));
c52ad3135bd3 implement reading files
lost
parents: 296
diff changeset
49 inputfiles[ninputfiles] = lw_malloc(sizeof(fileinfo_t));
c52ad3135bd3 implement reading files
lost
parents: 296
diff changeset
50 inputfiles[ninputfiles++] -> filename = lw_strdup(fn);
296
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents: 294
diff changeset
51 }
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents: 294
diff changeset
52