This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] ld/*.[ch]: Fix formatting.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: binutils at sources dot redhat dot com
- Date: Fri, 03 May 2002 07:41:08 -0400 (EDT)
- Subject: [patch] ld/*.[ch]: Fix formatting.
Hi,
Attached is a patch to fix formatting. OK to apply?
Kazu Hirata
2002-05-03 Kazu Hirata <kazu@cs.umass.edu>
* ld.h: Fix formatting.
* ldexp.c: Likewise.
* ldfile.c: Likewise.
* ldlang.c: Likewise.
* ldmain.c: Likewise.
* lexsup.c: Likewise.
* pe-dll.c: Likewise.
Index: ld.h
===================================================================
RCS file: /cvs/src/src/ld/ld.h,v
retrieving revision 1.16
diff -u -r1.16 ld.h
--- ld.h 2 Nov 2001 01:13:09 -0000 1.16
+++ ld.h 3 May 2002 11:37:09 -0000
@@ -1,5 +1,5 @@
/* ld.h -- general linker header file
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -103,7 +103,7 @@
/* 1 => assign space to common symbols even if `relocatable_output'. */
boolean force_common_definition;
- /* 1 => do not assign addresses to common symbols. */
+ /* 1 => do not assign addresses to common symbols. */
boolean inhibit_common_definition;
boolean relax;
Index: ldexp.c
===================================================================
RCS file: /cvs/src/src/ld/ldexp.c,v
retrieving revision 1.14
diff -u -r1.14 ldexp.c
--- ldexp.c 30 Apr 2002 09:21:27 -0000 1.14
+++ ldexp.c 3 May 2002 11:37:11 -0000
@@ -935,13 +935,13 @@
{
if (config.map_file == NULL)
config.map_file = stderr;
-
+
if (tree == NULL)
{
minfo ("NULL TREE\n");
return;
}
-
+
switch (tree->type.node_class)
{
case etree_value:
Index: ldfile.c
===================================================================
RCS file: /cvs/src/src/ld/ldfile.c,v
retrieving revision 1.14
diff -u -r1.14 ldfile.c
--- ldfile.c 2 Nov 2001 01:13:09 -0000 1.14
+++ ldfile.c 3 May 2002 11:37:11 -0000
@@ -1,5 +1,5 @@
/* Linker file opening and searching.
- Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001
+ Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -352,7 +352,7 @@
ldfile_input_filename = name;
lineno = 1;
-
+
saved_script_handle = ldlex_input_stack;
}
Index: ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.81
diff -u -r1.81 ldlang.c
--- ldlang.c 30 Apr 2002 09:21:27 -0000 1.81
+++ ldlang.c 3 May 2002 11:37:15 -0000
@@ -1474,7 +1474,7 @@
bfd_error_type err;
lang_statement_list_type *hold;
boolean bad_load = true;
-
+
err = bfd_get_error ();
/* See if the emulation has some special knowledge. */
@@ -1496,7 +1496,7 @@
einfo (_("%F%B: file not recognized: %E\n"), entry->the_bfd);
else
bad_load = false;
-
+
bfd_close (entry->the_bfd);
entry->the_bfd = NULL;
@@ -1537,7 +1537,7 @@
case bfd_archive:
if (entry->whole_archive)
{
- bfd * member = NULL;
+ bfd *member = NULL;
boolean loaded = true;
for (;;)
@@ -1546,7 +1546,7 @@
if (member == NULL)
break;
-
+
if (! bfd_check_format (member, bfd_object))
{
einfo (_("%F%B: member %B in archive is not an object\n"),
@@ -1602,7 +1602,7 @@
if (sec->spec.name != NULL && strcmp (sec->spec.name, "COMMON") == 0)
{
/* Remember the section that common is going to in case we
- later get something which doesn't know where to put it. */
+ later get something which doesn't know where to put it. */
default_common_section = output;
}
}
@@ -2842,23 +2842,23 @@
if ((region->current < region->origin
|| (region->current - region->origin > region->length))
&& ((region->current != region->origin + region->length)
- || base == 0))
+ || base == 0))
{
if (tree != (etree_type *) NULL)
- {
- einfo (_("%X%P: address 0x%v of %B section %s is not within region %s\n"),
- region->current,
- os->bfd_section->owner,
- os->bfd_section->name,
- region->name);
- }
+ {
+ einfo (_("%X%P: address 0x%v of %B section %s is not within region %s\n"),
+ region->current,
+ os->bfd_section->owner,
+ os->bfd_section->name,
+ region->name);
+ }
else
- {
- einfo (_("%X%P: region %s is full (%B section %s)\n"),
- region->name,
- os->bfd_section->owner,
- os->bfd_section->name);
- }
+ {
+ einfo (_("%X%P: region %s is full (%B section %s)\n"),
+ region->name,
+ os->bfd_section->owner,
+ os->bfd_section->name);
+ }
/* Reset the region pointer. */
region->current = region->origin;
}
@@ -3353,8 +3353,8 @@
if (value.valid_p == false)
einfo (_("%F%P: invalid data statement\n"));
}
- {
- unsigned int size;
+ {
+ unsigned int size;
switch (s->data_statement.type)
{
default:
@@ -3478,9 +3478,9 @@
h = bfd_link_hash_lookup (link_info.hash, buf, false, false, true);
if (h != NULL && h->type == bfd_link_hash_undefined)
{
- unsigned opb;
+ unsigned opb;
- opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
+ opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture,
ldfile_output_machine);
h->type = bfd_link_hash_defined;
if (s->_cooked_size != 0)
@@ -3627,7 +3627,7 @@
else if (bfd_count_sections (input_bfd))
{
/* If the input bfd has no contents, it shouldn't set the
- private data of the output bfd. */
+ private data of the output bfd. */
bfd_error_handler_type pfn = NULL;
@@ -4520,7 +4520,7 @@
/* If no runtime region has been given, but the load region has
been, use the load region. */
if (strcmp (memspec, "*default*") == 0)
- current_section->region = lang_memory_region_lookup (lma_memspec);
+ current_section->region = lang_memory_region_lookup (lma_memspec);
}
current_section->phdrs = phdrs;
stat_ptr = &statement_list;
@@ -4896,7 +4896,7 @@
name = current_section->name;
lang_leave_output_section_statement (fill, "*default*",
- phdrs, "*default*");
+ phdrs, "*default*");
/* Define the magic symbols. */
@@ -4933,7 +4933,7 @@
const char *lma_memspec;
{
lang_memory_region_type *region;
- lang_memory_region_type * default_region;
+ lang_memory_region_type *default_region;
lang_memory_region_type *lma_region;
struct overlay_list *l;
struct lang_nocrossref *nocrossref;
@@ -5246,7 +5246,7 @@
bfd_size_type len;
if (sec == NULL)
- continue;
+ continue;
len = bfd_section_size (is->the_bfd, sec);
contents = xmalloc (len);
Index: ldmain.c
===================================================================
RCS file: /cvs/src/src/ld/ldmain.c,v
retrieving revision 1.44
diff -u -r1.44 ldmain.c
--- ldmain.c 18 Mar 2002 02:55:51 -0000 1.44
+++ ldmain.c 3 May 2002 11:37:17 -0000
@@ -318,12 +318,12 @@
if (saved_script_handle == NULL)
{
int isfile;
- char *s = ldemul_get_script (& isfile);
+ char *s = ldemul_get_script (&isfile);
if (isfile)
ldfile_open_command_file (s);
else
- {
+ {
lex_string = s;
lex_redirect (s);
}
@@ -349,7 +349,7 @@
rewind (saved_script_handle);
while ((n = fread (buf, 1, ld_bufsz - 1, saved_script_handle)) > 0)
{
- buf [n] = 0;
+ buf[n] = 0;
info_msg (buf);
}
rewind (saved_script_handle);
@@ -359,9 +359,9 @@
{
int isfile;
- info_msg (ldemul_get_script (& isfile));
+ info_msg (ldemul_get_script (&isfile));
}
-
+
info_msg ("\n==================================================\n");
}
Index: lexsup.c
===================================================================
RCS file: /cvs/src/src/ld/lexsup.c,v
retrieving revision 1.48
diff -u -r1.48 lexsup.c
--- lexsup.c 11 Feb 2002 02:41:37 -0000 1.48
+++ lexsup.c 3 May 2002 11:37:19 -0000
@@ -804,7 +804,7 @@
increment optind, and continue because getopt is too confused
and will seg-fault the next time around. */
einfo(_("%P%F: bad -rpath option\n"));
-
+
link_info.relocateable = true;
config.build_constructors = false;
config.magic_demand_paged = false;
@@ -954,8 +954,8 @@
break;
case OPTION_TARGET_HELP:
/* Mention any target specific options. */
- ldemul_list_emulation_options (stdout);
- exit (0);
+ ldemul_list_emulation_options (stdout);
+ exit (0);
case OPTION_TBSS:
set_section_start (".bss", optarg);
break;
@@ -1009,7 +1009,7 @@
version information. Read it, but don't assume that
we've seen a linker script. */
{
- FILE * hold_script_handle;
+ FILE *hold_script_handle;
hold_script_handle = saved_script_handle;
ldfile_open_command_file (optarg);
@@ -1225,7 +1225,7 @@
int two_dashes =
(ld_options[j].control == TWO_DASHES
|| ld_options[j].control == EXACTLY_TWO_DASHES);
-
+
printf ("%s-%s%s",
comma ? ", " : "",
two_dashes ? "-" : "",
Index: pe-dll.c
===================================================================
RCS file: /cvs/src/src/ld/pe-dll.c,v
retrieving revision 1.38
diff -u -r1.38 pe-dll.c
--- pe-dll.c 15 Feb 2002 02:11:05 -0000 1.38
+++ pe-dll.c 3 May 2002 11:37:21 -0000
@@ -47,7 +47,7 @@
at the end of this file. This function is not re-entrant and is
normally only called once, so static variables are used to reduce
the number of parameters and return values required.
-
+
See also: ld/emultempl/pe.em. */
/* Auto-import feature by Paul Sokolovsky
@@ -243,7 +243,7 @@
{ "dllcrt2.o", 9 },
{ "gcrt0.o", 7 },
{ "gcrt1.o", 7 },
- { "gcrt2.o", 7 },
+ { "gcrt2.o", 7 },
{ NULL, 0 }
};
@@ -317,7 +317,7 @@
exit (1);
}
-/* Helper functions for qsort. Relocs must be sorted so that we can write
+/* Helper functions for qsort. Relocs must be sorted so that we can write
them out by pages. */
typedef struct
@@ -446,11 +446,11 @@
if (abfd && (p = lbasename (abfd->filename)))
{
- afptr = autofilter_objlist;
- while (afptr->name)
+ afptr = autofilter_objlist;
+ while (afptr->name)
{
- if ( strcmp (p, afptr->name) == 0 )
- return 0;
+ if (strcmp (p, afptr->name) == 0)
+ return 0;
afptr++;
}
}
@@ -466,7 +466,7 @@
if (strcmp (n, afptr->name) == 0)
return 0;
- afptr ++;
+ afptr++;
}
/* Next, exclude symbols starting with ... */
@@ -476,7 +476,7 @@
if (strncmp (n, afptr->name, afptr->len) == 0)
return 0;
- afptr ++;
+ afptr++;
}
/* Finally, exclude symbols ending with ... */
@@ -484,13 +484,13 @@
afptr = autofilter_symbolsuffixlist;
while (afptr->name)
{
- if ((len >= afptr->len) &&
+ if ((len >= afptr->len) &&
/* Add 1 to insure match with trailing '\0'. */
- strncmp (n + len - afptr->len, afptr->name,
+ strncmp (n + len - afptr->len, afptr->name,
afptr->len + 1) == 0)
return 0;
- afptr ++;
+ afptr++;
}
}
@@ -560,10 +560,10 @@
sprintf (name, "%s%s", U("_imp_"), sn);
blhe = bfd_link_hash_lookup (info->hash, name,
- false, false, false);
+ false, false, false);
free (name);
- if (blhe && blhe->type == bfd_link_hash_defined)
+ if (blhe && blhe->type == bfd_link_hash_defined)
continue;
}
@@ -863,7 +863,7 @@
if (pe_def_file->exports[i].ordinal == -1)
{
while (exported_symbols[next_ordinal - min_ordinal] != -1)
- next_ordinal ++;
+ next_ordinal++;
exported_symbols[next_ordinal - min_ordinal] = i;
pe_def_file->exports[i].ordinal = next_ordinal;
@@ -1112,9 +1112,9 @@
for (i = 0; i < nrelocs; i++)
{
if (pe_dll_extra_pe_debug)
- {
+ {
struct symbol_cache_entry *sym = *relocs[i]->sym_ptr_ptr;
- printf("rel: %s\n",sym->name);
+ printf ("rel: %s\n", sym->name);
}
if (!relocs[i]->howto->pc_relative
&& relocs[i]->howto->type != pe_details->imagebase_reloc)
@@ -1193,7 +1193,7 @@
if (reloc_data[i].type == 4)
reloc_sz += 2;
}
-
+
reloc_sz = (reloc_sz + 3) & ~3; /* 4-byte align. */
reloc_d = (unsigned char *) xmalloc (reloc_sz);
sec_page = (unsigned long) (-1);
@@ -1551,11 +1551,11 @@
.long 0
.rva __my_dll_iname
.rva fthunk
-
+
.section .idata$5
.long 0
fthunk:
-
+
.section .idata$4
.long 0
hname: */
@@ -1695,10 +1695,10 @@
.global __imp__function
_function:
jmp *__imp__function:
-
+
.section idata$7
.long __head_my_dll
-
+
.section .idata$5
___imp_function:
__imp__function:
@@ -1949,9 +1949,9 @@
static int counter;
static char *fixup_name = NULL;
static size_t buffer_len = 0;
-
+
struct symbol_cache_entry *sym = *rel->sym_ptr_ptr;
-
+
bfd *abfd = bfd_asymbol_bfd (sym);
struct coff_link_hash_entry *myh = NULL;
@@ -1962,7 +1962,7 @@
}
if (strlen (sym->name) + 25 > buffer_len)
- /* Assume 25 chars for "__fu" + counter + "_". If counter is
+ /* Assume 25 chars for "__fu" + counter + "_". If counter is
bigger than 20 digits long, we've got worse problems than
overflowing this buffer... */
{
@@ -1972,17 +1972,17 @@
buffer_len = ((strlen (sym->name) + 25) + 127) & ~127;
fixup_name = (char *) xmalloc (buffer_len);
}
-
+
sprintf (fixup_name, "__fu%d_%s", counter++, sym->name);
- bfd_coff_link_add_one_symbol (&link_info, abfd, fixup_name, BSF_GLOBAL,
+ bfd_coff_link_add_one_symbol (&link_info, abfd, fixup_name, BSF_GLOBAL,
current_sec, /* sym->section, */
rel->address, NULL, true, false,
(struct bfd_link_hash_entry **) &myh);
#if 0
- printf ("type:%d\n", myh->type);
- printf ("%s\n", myh->root.u.def.section->name);
+ printf ("type:%d\n", myh->type);
+ printf ("%s\n", myh->root.u.def.section->name);
#endif
return fixup_name;
}
@@ -1995,7 +1995,7 @@
.rva __fuNN_SYM (pointer to reference (address) in text) */
static bfd *
-make_import_fixup_entry (name, fixup_name, dll_symname,parent)
+make_import_fixup_entry (name, fixup_name, dll_symname, parent)
const char *name;
const char *fixup_name;
const char *dll_symname;
@@ -2021,8 +2021,8 @@
symtab = (asymbol **) xmalloc (6 * sizeof (asymbol *));
id3 = quick_section (abfd, ".idata$3", SEC_HAS_CONTENTS, 2);
-#if 0
- quick_symbol (abfd, U ("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0);
+#if 0
+ quick_symbol (abfd, U ("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0);
#endif
quick_symbol (abfd, U ("_nm_thnk_"), name, "", UNDSEC, BSF_GLOBAL, 0);
quick_symbol (abfd, U (""), dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0);