* Makefile.am (syslex.o, sysinfo.o): Pass AM_CFLAGS to compiler.
(syslex.o, sysinfo.o, dlltool.o, rescoff.o): Remove duplicate dependencies. Run "make dep-am". * nlmconv.c: Warning fixes. * readelf.c: Likewise. * srconv.c: Likewise. * sysdump.c: Likewise. * sysinfo.y: Likewise. * syslex.l: Likewise. Use yyleng instead of strlen, memcpy instead of strcpy. * Makefile.in: Regenerate.
This commit is contained in:
parent
58e2ea4d1c
commit
dc3c06c291
9 changed files with 95 additions and 65 deletions
|
@ -1,3 +1,17 @@
|
||||||
|
2005-02-22 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* Makefile.am (syslex.o, sysinfo.o): Pass AM_CFLAGS to compiler.
|
||||||
|
(syslex.o, sysinfo.o, dlltool.o, rescoff.o): Remove duplicate
|
||||||
|
dependencies. Run "make dep-am".
|
||||||
|
* nlmconv.c: Warning fixes.
|
||||||
|
* readelf.c: Likewise.
|
||||||
|
* srconv.c: Likewise.
|
||||||
|
* sysdump.c: Likewise.
|
||||||
|
* sysinfo.y: Likewise.
|
||||||
|
* syslex.l: Likewise. Use yyleng instead of strlen, memcpy instead
|
||||||
|
of strcpy.
|
||||||
|
* Makefile.in: Regenerate.
|
||||||
|
|
||||||
2005-02-21 H.J. Lu <hongjiu.lu@intel.com>
|
2005-02-21 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* objcopy.c (parse_flags): Replace SEC_SHARED with
|
* objcopy.c (parse_flags): Replace SEC_SHARED with
|
||||||
|
|
|
@ -221,18 +221,18 @@ sysroff.h: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info
|
||||||
sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
|
sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
|
||||||
$(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o
|
$(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o
|
||||||
|
|
||||||
syslex.o: syslex.c sysinfo.h
|
syslex.o:
|
||||||
if [ -r syslex.c ]; then \
|
if [ -r syslex.c ]; then \
|
||||||
$(CC_FOR_BUILD) -c -I. $(CFLAGS) syslex.c ; \
|
$(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) syslex.c ; \
|
||||||
else \
|
else \
|
||||||
$(CC_FOR_BUILD) -c -I. -I$(srcdir) $(CFLAGS) $(srcdir)/syslex.c ;\
|
$(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/syslex.c ;\
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sysinfo.o: sysinfo.c
|
sysinfo.o:
|
||||||
if [ -r sysinfo.c ]; then \
|
if [ -r sysinfo.c ]; then \
|
||||||
$(CC_FOR_BUILD) -c -I. $(CFLAGS) sysinfo.c ; \
|
$(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) sysinfo.c ; \
|
||||||
else \
|
else \
|
||||||
$(CC_FOR_BUILD) -c -I. $(CFLAGS) $(srcdir)/sysinfo.c ; \
|
$(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We need these for parallel make.
|
# We need these for parallel make.
|
||||||
|
@ -247,10 +247,10 @@ srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
|
||||||
dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
|
dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
|
||||||
dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||||
|
|
||||||
dlltool.o:dlltool.c
|
dlltool.o:
|
||||||
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
|
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
|
||||||
|
|
||||||
rescoff.o:rescoff.c
|
rescoff.o:
|
||||||
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/rescoff.c
|
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/rescoff.c
|
||||||
|
|
||||||
coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
|
coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
|
||||||
|
@ -544,7 +544,7 @@ arlex.o: arlex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
|
||||||
arparse.h
|
arparse.h
|
||||||
sysroff.o: sysroff.c
|
sysroff.o: sysroff.c
|
||||||
sysinfo.o: sysinfo.c
|
sysinfo.o: sysinfo.c
|
||||||
syslex.o: syslex.c sysinfo.h
|
syslex.o: syslex.c config.h sysinfo.h
|
||||||
defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||||
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||||
$(INCDIR)/fopen-same.h dlltool.h
|
$(INCDIR)/fopen-same.h dlltool.h
|
||||||
|
|
|
@ -991,18 +991,18 @@ sysroff.h: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info
|
||||||
sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
|
sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
|
||||||
$(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o
|
$(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o
|
||||||
|
|
||||||
syslex.o: syslex.c sysinfo.h
|
syslex.o:
|
||||||
if [ -r syslex.c ]; then \
|
if [ -r syslex.c ]; then \
|
||||||
$(CC_FOR_BUILD) -c -I. $(CFLAGS) syslex.c ; \
|
$(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) syslex.c ; \
|
||||||
else \
|
else \
|
||||||
$(CC_FOR_BUILD) -c -I. -I$(srcdir) $(CFLAGS) $(srcdir)/syslex.c ;\
|
$(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/syslex.c ;\
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sysinfo.o: sysinfo.c
|
sysinfo.o:
|
||||||
if [ -r sysinfo.c ]; then \
|
if [ -r sysinfo.c ]; then \
|
||||||
$(CC_FOR_BUILD) -c -I. $(CFLAGS) sysinfo.c ; \
|
$(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) sysinfo.c ; \
|
||||||
else \
|
else \
|
||||||
$(CC_FOR_BUILD) -c -I. $(CFLAGS) $(srcdir)/sysinfo.c ; \
|
$(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We need these for parallel make.
|
# We need these for parallel make.
|
||||||
|
@ -1012,10 +1012,10 @@ nlmheader.h: nlmheader.c
|
||||||
rcparse.h: rcparse.c
|
rcparse.h: rcparse.c
|
||||||
sysinfo.h: sysinfo.c
|
sysinfo.h: sysinfo.c
|
||||||
|
|
||||||
dlltool.o:dlltool.c
|
dlltool.o:
|
||||||
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
|
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
|
||||||
|
|
||||||
rescoff.o:rescoff.c
|
rescoff.o:
|
||||||
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/rescoff.c
|
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/rescoff.c
|
||||||
|
|
||||||
# coff/sym.h and coff/ecoff.h won't be found by the automatic dependency
|
# coff/sym.h and coff/ecoff.h won't be found by the automatic dependency
|
||||||
|
@ -1283,7 +1283,7 @@ arlex.o: arlex.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
|
||||||
arparse.h
|
arparse.h
|
||||||
sysroff.o: sysroff.c
|
sysroff.o: sysroff.c
|
||||||
sysinfo.o: sysinfo.c
|
sysinfo.o: sysinfo.c
|
||||||
syslex.o: syslex.c sysinfo.h
|
syslex.o: syslex.c config.h sysinfo.h
|
||||||
defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||||
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
$(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||||
$(INCDIR)/fopen-same.h dlltool.h
|
$(INCDIR)/fopen-same.h dlltool.h
|
||||||
|
|
|
@ -193,7 +193,7 @@ main (int argc, char **argv)
|
||||||
bfd *sharedbfd;
|
bfd *sharedbfd;
|
||||||
size_t shared_offset = 0;
|
size_t shared_offset = 0;
|
||||||
size_t shared_size = 0;
|
size_t shared_size = 0;
|
||||||
Nlm_Internal_Fixed_Header sharedhdr;
|
static Nlm_Internal_Fixed_Header sharedhdr;
|
||||||
int len;
|
int len;
|
||||||
char *modname;
|
char *modname;
|
||||||
char **matching;
|
char **matching;
|
||||||
|
@ -976,7 +976,7 @@ main (int argc, char **argv)
|
||||||
for (l = modules; l != NULL; l = l->next)
|
for (l = modules; l != NULL; l = l->next)
|
||||||
{
|
{
|
||||||
*set = strlen (l->string);
|
*set = strlen (l->string);
|
||||||
strncpy (set + 1, l->string, *set);
|
strncpy ((char *) set + 1, l->string, *set);
|
||||||
set += *set + 1;
|
set += *set + 1;
|
||||||
++c;
|
++c;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4027,7 +4027,8 @@ process_section_groups (FILE *file)
|
||||||
if (section->sh_type == SHT_GROUP)
|
if (section->sh_type == SHT_GROUP)
|
||||||
{
|
{
|
||||||
char *name = SECTION_NAME (section);
|
char *name = SECTION_NAME (section);
|
||||||
char *group_name, *start, *indices;
|
char *group_name;
|
||||||
|
unsigned char *start, *indices;
|
||||||
unsigned int entry, j, size;
|
unsigned int entry, j, size;
|
||||||
Elf_Internal_Shdr *sec;
|
Elf_Internal_Shdr *sec;
|
||||||
Elf_Internal_Sym *sym;
|
Elf_Internal_Sym *sym;
|
||||||
|
@ -7011,7 +7012,7 @@ dump_section (Elf_Internal_Shdr *section, FILE *file)
|
||||||
|
|
||||||
|
|
||||||
static unsigned long int
|
static unsigned long int
|
||||||
read_leb128 (unsigned char *data, int *length_return, int sign)
|
read_leb128 (unsigned char *data, unsigned int *length_return, int sign)
|
||||||
{
|
{
|
||||||
unsigned long int result = 0;
|
unsigned long int result = 0;
|
||||||
unsigned int num_read = 0;
|
unsigned int num_read = 0;
|
||||||
|
@ -7075,7 +7076,7 @@ static int
|
||||||
process_extended_line_op (unsigned char *data, int is_stmt, int pointer_size)
|
process_extended_line_op (unsigned char *data, int is_stmt, int pointer_size)
|
||||||
{
|
{
|
||||||
unsigned char op_code;
|
unsigned char op_code;
|
||||||
int bytes_read;
|
unsigned int bytes_read;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
unsigned char *name;
|
unsigned char *name;
|
||||||
unsigned long adr;
|
unsigned long adr;
|
||||||
|
@ -7445,7 +7446,7 @@ process_abbrev_section (unsigned char *start, unsigned char *end)
|
||||||
|
|
||||||
while (start < end)
|
while (start < end)
|
||||||
{
|
{
|
||||||
int bytes_read;
|
unsigned int bytes_read;
|
||||||
unsigned long entry;
|
unsigned long entry;
|
||||||
unsigned long tag;
|
unsigned long tag;
|
||||||
unsigned long attribute;
|
unsigned long attribute;
|
||||||
|
@ -7620,7 +7621,7 @@ decode_location_expression (unsigned char * data,
|
||||||
unsigned long cu_offset)
|
unsigned long cu_offset)
|
||||||
{
|
{
|
||||||
unsigned op;
|
unsigned op;
|
||||||
int bytes_read;
|
unsigned int bytes_read;
|
||||||
unsigned long uvalue;
|
unsigned long uvalue;
|
||||||
unsigned char *end = data + length;
|
unsigned char *end = data + length;
|
||||||
int need_frame_base = 0;
|
int need_frame_base = 0;
|
||||||
|
@ -7990,7 +7991,7 @@ read_and_display_attr_value (unsigned long attribute,
|
||||||
{
|
{
|
||||||
unsigned long uvalue = 0;
|
unsigned long uvalue = 0;
|
||||||
unsigned char *block_start = NULL;
|
unsigned char *block_start = NULL;
|
||||||
int bytes_read;
|
unsigned int bytes_read;
|
||||||
|
|
||||||
switch (form)
|
switch (form)
|
||||||
{
|
{
|
||||||
|
@ -8729,7 +8730,7 @@ process_debug_info (Elf_Internal_Shdr *section, unsigned char *start,
|
||||||
level = 0;
|
level = 0;
|
||||||
while (tags < start)
|
while (tags < start)
|
||||||
{
|
{
|
||||||
int bytes_read;
|
unsigned int bytes_read;
|
||||||
unsigned long abbrev_number;
|
unsigned long abbrev_number;
|
||||||
abbrev_entry *entry;
|
abbrev_entry *entry;
|
||||||
abbrev_attr *attr;
|
abbrev_attr *attr;
|
||||||
|
@ -9031,7 +9032,7 @@ display_debug_lines (Elf_Internal_Shdr *section,
|
||||||
while (*data != 0)
|
while (*data != 0)
|
||||||
{
|
{
|
||||||
unsigned char *name;
|
unsigned char *name;
|
||||||
int bytes_read;
|
unsigned int bytes_read;
|
||||||
|
|
||||||
printf (_(" %d\t"), ++state_machine_regs.last_file_entry);
|
printf (_(" %d\t"), ++state_machine_regs.last_file_entry);
|
||||||
name = data;
|
name = data;
|
||||||
|
@ -9058,7 +9059,7 @@ display_debug_lines (Elf_Internal_Shdr *section,
|
||||||
{
|
{
|
||||||
unsigned char op_code;
|
unsigned char op_code;
|
||||||
int adv;
|
int adv;
|
||||||
int bytes_read;
|
unsigned int bytes_read;
|
||||||
|
|
||||||
op_code = *data++;
|
op_code = *data++;
|
||||||
|
|
||||||
|
@ -9306,7 +9307,7 @@ display_debug_macinfo (Elf_Internal_Shdr *section,
|
||||||
case DW_MACINFO_define:
|
case DW_MACINFO_define:
|
||||||
lineno = read_leb128 (curr, & bytes_read, 0);
|
lineno = read_leb128 (curr, & bytes_read, 0);
|
||||||
curr += bytes_read;
|
curr += bytes_read;
|
||||||
string = curr;
|
string = (char *) curr;
|
||||||
curr += strlen (string) + 1;
|
curr += strlen (string) + 1;
|
||||||
printf (_(" DW_MACINFO_define - lineno : %d macro : %s\n"),
|
printf (_(" DW_MACINFO_define - lineno : %d macro : %s\n"),
|
||||||
lineno, string);
|
lineno, string);
|
||||||
|
@ -9315,7 +9316,7 @@ display_debug_macinfo (Elf_Internal_Shdr *section,
|
||||||
case DW_MACINFO_undef:
|
case DW_MACINFO_undef:
|
||||||
lineno = read_leb128 (curr, & bytes_read, 0);
|
lineno = read_leb128 (curr, & bytes_read, 0);
|
||||||
curr += bytes_read;
|
curr += bytes_read;
|
||||||
string = curr;
|
string = (char *) curr;
|
||||||
curr += strlen (string) + 1;
|
curr += strlen (string) + 1;
|
||||||
printf (_(" DW_MACINFO_undef - lineno : %d macro : %s\n"),
|
printf (_(" DW_MACINFO_undef - lineno : %d macro : %s\n"),
|
||||||
lineno, string);
|
lineno, string);
|
||||||
|
@ -9327,7 +9328,7 @@ display_debug_macinfo (Elf_Internal_Shdr *section,
|
||||||
|
|
||||||
constant = read_leb128 (curr, & bytes_read, 0);
|
constant = read_leb128 (curr, & bytes_read, 0);
|
||||||
curr += bytes_read;
|
curr += bytes_read;
|
||||||
string = curr;
|
string = (char *) curr;
|
||||||
curr += strlen (string) + 1;
|
curr += strlen (string) + 1;
|
||||||
printf (_(" DW_MACINFO_vendor_ext - constant : %d string : %s\n"),
|
printf (_(" DW_MACINFO_vendor_ext - constant : %d string : %s\n"),
|
||||||
constant, string);
|
constant, string);
|
||||||
|
@ -10006,7 +10007,7 @@ display_debug_frames (Elf_Internal_Shdr *section,
|
||||||
Frame_Chunk *remembered_state = 0;
|
Frame_Chunk *remembered_state = 0;
|
||||||
Frame_Chunk *rs;
|
Frame_Chunk *rs;
|
||||||
int is_eh = streq (SECTION_NAME (section), ".eh_frame");
|
int is_eh = streq (SECTION_NAME (section), ".eh_frame");
|
||||||
int length_return;
|
unsigned int length_return;
|
||||||
int max_regs = 0;
|
int max_regs = 0;
|
||||||
|
|
||||||
printf (_("The section %s contains:\n"), SECTION_NAME (section));
|
printf (_("The section %s contains:\n"), SECTION_NAME (section));
|
||||||
|
@ -10074,8 +10075,8 @@ display_debug_frames (Elf_Internal_Shdr *section,
|
||||||
|
|
||||||
version = *start++;
|
version = *start++;
|
||||||
|
|
||||||
fc->augmentation = start;
|
fc->augmentation = (char *) start;
|
||||||
start = strchr (start, '\0') + 1;
|
start = (unsigned char *) strchr ((char *) start, '\0') + 1;
|
||||||
|
|
||||||
if (fc->augmentation[0] == 'z')
|
if (fc->augmentation[0] == 'z')
|
||||||
{
|
{
|
||||||
|
@ -10151,7 +10152,7 @@ display_debug_frames (Elf_Internal_Shdr *section,
|
||||||
if (augmentation_data_len)
|
if (augmentation_data_len)
|
||||||
{
|
{
|
||||||
unsigned char *p, *q;
|
unsigned char *p, *q;
|
||||||
p = fc->augmentation + 1;
|
p = (unsigned char *) fc->augmentation + 1;
|
||||||
q = augmentation_data;
|
q = augmentation_data;
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* srconv.c -- Sysroff conversion program
|
/* srconv.c -- Sysroff conversion program
|
||||||
Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||||
Free Software Foundation, Inc.
|
2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Binutils.
|
This file is part of GNU Binutils.
|
||||||
|
|
||||||
|
@ -46,11 +46,11 @@ static int get_member_id (int);
|
||||||
static int get_ordinary_id (int);
|
static int get_ordinary_id (int);
|
||||||
static char *section_translate (char *);
|
static char *section_translate (char *);
|
||||||
static char *strip_suffix (char *);
|
static char *strip_suffix (char *);
|
||||||
static void checksum (FILE *, char *, int, int);
|
static void checksum (FILE *, unsigned char *, int, int);
|
||||||
static void writeINT (int, char *, int *, int, FILE *);
|
static void writeINT (int, unsigned char *, int *, int, FILE *);
|
||||||
static void writeBITS (int, char *, int *, int);
|
static void writeBITS (int, unsigned char *, int *, int);
|
||||||
static void writeBARRAY (barray, char *, int *, int, FILE *);
|
static void writeBARRAY (barray, unsigned char *, int *, int, FILE *);
|
||||||
static void writeCHARS (char *, char *, int *, int, FILE *);
|
static void writeCHARS (char *, unsigned char *, int *, int, FILE *);
|
||||||
static void wr_tr (void);
|
static void wr_tr (void);
|
||||||
static void wr_un (struct coff_ofile *, struct coff_sfile *, int, int);
|
static void wr_un (struct coff_ofile *, struct coff_sfile *, int, int);
|
||||||
static void wr_hd (struct coff_ofile *);
|
static void wr_hd (struct coff_ofile *);
|
||||||
|
@ -158,7 +158,7 @@ strip_suffix (char *name)
|
||||||
|
|
||||||
/* IT LEN stuff CS */
|
/* IT LEN stuff CS */
|
||||||
static void
|
static void
|
||||||
checksum (FILE *file, char *ptr, int size, int code)
|
checksum (FILE *file, unsigned char *ptr, int size, int code)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
int last;
|
int last;
|
||||||
|
@ -181,7 +181,7 @@ checksum (FILE *file, char *ptr, int size, int code)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
writeINT (int n, char *ptr, int *idx, int size, FILE *file)
|
writeINT (int n, unsigned char *ptr, int *idx, int size, FILE *file)
|
||||||
{
|
{
|
||||||
int byte = *idx / 8;
|
int byte = *idx / 8;
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ writeINT (int n, char *ptr, int *idx, int size, FILE *file)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
writeBITS (int val, char *ptr, int *idx, int size)
|
writeBITS (int val, unsigned char *ptr, int *idx, int size)
|
||||||
{
|
{
|
||||||
int byte = *idx / 8;
|
int byte = *idx / 8;
|
||||||
int bit = *idx % 8;
|
int bit = *idx % 8;
|
||||||
|
@ -239,8 +239,8 @@ writeBITS (int val, char *ptr, int *idx, int size)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
writeBARRAY (barray data, char *ptr, int *idx, int size ATTRIBUTE_UNUSED,
|
writeBARRAY (barray data, unsigned char *ptr, int *idx,
|
||||||
FILE *file)
|
int size ATTRIBUTE_UNUSED, FILE *file)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ writeBARRAY (barray data, char *ptr, int *idx, int size ATTRIBUTE_UNUSED,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
writeCHARS (char *string, char *ptr, int *idx, int size, FILE *file)
|
writeCHARS (char *string, unsigned char *ptr, int *idx, int size, FILE *file)
|
||||||
{
|
{
|
||||||
int i = *idx / 8;
|
int i = *idx / 8;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Sysroff object format dumper.
|
/* Sysroff object format dumper.
|
||||||
Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003
|
Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2005
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Binutils.
|
This file is part of GNU Binutils.
|
||||||
|
@ -55,10 +55,10 @@ static void module (void);
|
||||||
static void show_usage (FILE *, int);
|
static void show_usage (FILE *, int);
|
||||||
|
|
||||||
extern char *getCHARS (unsigned char *, int *, int, int);
|
extern char *getCHARS (unsigned char *, int *, int, int);
|
||||||
extern int fillup (char *);
|
extern int fillup (unsigned char *);
|
||||||
extern barray getBARRAY (unsigned char *, int *, int, int);
|
extern barray getBARRAY (unsigned char *, int *, int, int);
|
||||||
extern int getINT (unsigned char *, int *, int, int);
|
extern int getINT (unsigned char *, int *, int, int);
|
||||||
extern int getBITS (char *, int *, int, int);
|
extern int getBITS (unsigned char *, int *, int, int);
|
||||||
extern void sysroff_swap_tr_in (void);
|
extern void sysroff_swap_tr_in (void);
|
||||||
extern void sysroff_print_tr_out (void);
|
extern void sysroff_print_tr_out (void);
|
||||||
extern int main (int, char **);
|
extern int main (int, char **);
|
||||||
|
@ -121,7 +121,7 @@ dh (unsigned char *ptr, int size)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
fillup (char *ptr)
|
fillup (unsigned char *ptr)
|
||||||
{
|
{
|
||||||
int size;
|
int size;
|
||||||
int sum;
|
int sum;
|
||||||
|
@ -198,7 +198,7 @@ getINT (unsigned char *ptr, int *idx, int size, int max)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
getBITS (char *ptr, int *idx, int size, int max)
|
getBITS (unsigned char *ptr, int *idx, int size, int max)
|
||||||
{
|
{
|
||||||
int byte = *idx / 8;
|
int byte = *idx / 8;
|
||||||
int bit = *idx % 8;
|
int bit = *idx % 8;
|
||||||
|
@ -265,7 +265,7 @@ pbarray (barray *y)
|
||||||
void
|
void
|
||||||
sysroff_swap_tr_in (void)
|
sysroff_swap_tr_in (void)
|
||||||
{
|
{
|
||||||
char raw[255];
|
unsigned char raw[255];
|
||||||
|
|
||||||
memset (raw, 0, 255);
|
memset (raw, 0, 255);
|
||||||
fillup (raw);
|
fillup (raw);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright 2001, 2003 Free Software Foundation, Inc.
|
/* Copyright 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||||
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
|
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
|
||||||
|
|
||||||
This file is part of GNU binutils.
|
This file is part of GNU binutils.
|
||||||
|
@ -37,6 +37,9 @@ int rdepth;
|
||||||
char *loop [] = {"","n","m","/*BAD*/"};
|
char *loop [] = {"","n","m","/*BAD*/"};
|
||||||
char *names[] = {" ","[n]","[n][m]"};
|
char *names[] = {" ","[n]","[n][m]"};
|
||||||
char *pnames[]= {"","*","**"};
|
char *pnames[]= {"","*","**"};
|
||||||
|
|
||||||
|
static int yyerror (char *s);
|
||||||
|
extern int yylex (void);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,7 +120,7 @@ it:
|
||||||
printf("void sysroff_swap_%s_in(ptr)\n",$2);
|
printf("void sysroff_swap_%s_in(ptr)\n",$2);
|
||||||
printf("struct IT_%s *ptr;\n", it);
|
printf("struct IT_%s *ptr;\n", it);
|
||||||
printf("{\n");
|
printf("{\n");
|
||||||
printf("char raw[255];\n");
|
printf("unsigned char raw[255];\n");
|
||||||
printf("\tint idx = 0 ;\n");
|
printf("\tint idx = 0 ;\n");
|
||||||
printf("\tint size;\n");
|
printf("\tint size;\n");
|
||||||
printf("memset(raw,0,255);\n");
|
printf("memset(raw,0,255);\n");
|
||||||
|
@ -129,7 +132,7 @@ it:
|
||||||
printf("FILE * file;\n");
|
printf("FILE * file;\n");
|
||||||
printf("struct IT_%s *ptr;\n", it);
|
printf("struct IT_%s *ptr;\n", it);
|
||||||
printf("{\n");
|
printf("{\n");
|
||||||
printf("\tchar raw[255];\n");
|
printf("\tunsigned char raw[255];\n");
|
||||||
printf("\tint idx = 16 ;\n");
|
printf("\tint idx = 16 ;\n");
|
||||||
printf("\tmemset (raw, 0, 255);\n");
|
printf("\tmemset (raw, 0, 255);\n");
|
||||||
printf("\tcode = IT_%s_CODE;\n", it);
|
printf("\tcode = IT_%s_CODE;\n", it);
|
||||||
|
@ -431,7 +434,7 @@ if (writecode == 'd')
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
yyerror (char *s)
|
yyerror (char *s)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s\n" , s);
|
fprintf(stderr, "%s\n" , s);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%{
|
%{
|
||||||
/* Copyright 2001, 2003 Free Software Foundation, Inc.
|
/* Copyright 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GLD, the Gnu Linker.
|
This file is part of GLD, the Gnu Linker.
|
||||||
|
|
||||||
|
@ -18,14 +18,26 @@ along with GLD; see the file COPYING. If not, write to the Free
|
||||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||||
02111-1307, USA. */
|
02111-1307, USA. */
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#ifdef HAVE_STRING_H
|
||||||
|
#include <string.h>
|
||||||
|
#else
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#include "sysinfo.h"
|
#include "sysinfo.h"
|
||||||
char *word;
|
char *word;
|
||||||
int number;
|
int number;
|
||||||
int unit;
|
int unit;
|
||||||
|
|
||||||
|
#define YY_NO_UNPUT
|
||||||
|
|
||||||
#ifndef yywrap
|
#ifndef yywrap
|
||||||
static int yywrap (void) { return 1; }
|
static int yywrap (void) { return 1; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern int yylex (void);
|
||||||
%}
|
%}
|
||||||
%%
|
%%
|
||||||
"(" { return '(';}
|
"(" { return '(';}
|
||||||
|
@ -37,9 +49,9 @@ static int yywrap (void) { return 1; }
|
||||||
"\t" { ; }
|
"\t" { ; }
|
||||||
"\n" { ; }
|
"\n" { ; }
|
||||||
"\""[^\"]*"\"" {
|
"\""[^\"]*"\"" {
|
||||||
yylval.s = malloc(strlen (yytext));
|
yylval.s = malloc (yyleng - 1);
|
||||||
strcpy(yylval.s, yytext+1);
|
memcpy (yylval.s, yytext + 1, yyleng - 2);
|
||||||
yylval.s[strlen(yylval.s)-1] = 0;
|
yylval.s[yyleng - 2] = '\0';
|
||||||
return NAME;
|
return NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue