ld: Move the .note.build-id section to near the start of the memory map.
[binutils-gdb.git] / sim / ppc / lf-ppc.c
blob469f0fbe4958dc998371a9190b86f05e0b914df8
1 /* This file is part of the program psim.
3 Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #include <ctype.h>
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
25 #include "lf.h"
26 #include "lf-ppc.h"
28 int
29 lf_print__c_code(lf *file,
30 const char *code)
32 int nr = 0;
33 const char *chp = code;
34 int in_bit_field = 0;
35 while (*chp != '\0') {
36 if (*chp == '\t')
37 chp++;
38 if (*chp == '#')
39 lf_indent_suppress(file);
40 while (*chp != '\0' && *chp != '\n') {
41 if (chp[0] == '{' && !isspace(chp[1])) {
42 in_bit_field = 1;
43 nr += lf_putchr(file, '_');
45 else if (in_bit_field && chp[0] == ':') {
46 nr += lf_putchr(file, '_');
48 else if (in_bit_field && *chp == '}') {
49 nr += lf_putchr(file, '_');
50 in_bit_field = 0;
52 else {
53 nr += lf_putchr(file, *chp);
55 chp++;
57 if (in_bit_field)
58 ERROR("bit field paren miss match some where\n");
59 if (*chp == '\n') {
60 nr += lf_putchr(file, '\n');
61 chp++;
64 nr += lf_putchr(file, '\n');
65 return nr;