the file in the string table. This pass moves all strings
into memory and replaces them with pointers to the strings.
-
The symbol table is massaged once again, this time to create
the canonical table used by the BFD application. Each symbol
is inspected in turn, and a decision made (using the
.boolean done_lineno;
.} coff_symbol_type;
-
*/
#ifdef COFF_WITH_PE
styp_flags |= IMAGE_SCN_LNK_REMOVE;
/* skip IN_MEMORY */
/* skip SORT */
- if (sec_flags & SEC_LINK_ONCE)
- styp_flags |= IMAGE_SCN_LNK_COMDAT;
+ if (sec_flags & SEC_LINK_ONCE)
+ styp_flags |= IMAGE_SCN_LNK_COMDAT;
/* skip LINK_DUPLICATES */
/* skip LINKER_CREATED */
though the semantics don't quite match. The bits from the input
are retained in pei_section_data(abfd, section)->pe_flags */
- styp_flags |= IMAGE_SCN_MEM_READ; /* always readable. */
+ styp_flags |= IMAGE_SCN_MEM_READ; /* always readable. */
if ((sec_flags & SEC_READONLY) == 0)
styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write */
if (sec_flags & SEC_CODE)
if (sec_flags & SEC_SHARED)
styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful */
- return styp_flags;
+ return styp_flags;
}
#endif /* COFF_WITH_PE */
#ifdef STYP_BLOCK
if (styp_flags & STYP_BLOCK)
sec_flags |= SEC_BLOCK;
-#endif
+#endif
#ifdef STYP_CLINK
if (styp_flags & STYP_CLINK)
sec_flags |= SEC_CLINK;
-#endif
+#endif
#ifdef STYP_NOLOAD
if (styp_flags & STYP_NOLOAD)
if (styp_flags & IMAGE_SCN_MEM_EXECUTE)
sec_flags |= SEC_CODE; /* Probably redundant */
- /* IMAGE_SCN_MEM_READ is simply ignored, assuming it always to be true. */
+ /* IMAGE_SCN_MEM_READ is simply ignored, assuming it always to be true. */
if ((styp_flags & IMAGE_SCN_MEM_WRITE) == 0)
sec_flags |= SEC_READONLY;
if (strcmp (name, symname) != 0)
abort ();
-
+
/* This is the section symbol. */
bfd_coff_swap_aux_in (abfd, (PTR) (esym + bfd_coff_symesz (abfd)),
switch (aux.x_scn.x_comdat)
{
case IMAGE_COMDAT_SELECT_NODUPLICATES:
-#ifdef STRICT_PE_FORMAT
+#ifdef STRICT_PE_FORMAT
sec_flags |= SEC_LINK_DUPLICATES_ONE_ONLY;
#else
sec_flags &= ~SEC_LINK_ONCE;
#define TARGET_UNDERSCORE 0
#endif
/* Is this the name we're looking for? */
- if (strcmp (target_name,
+ if (strcmp (target_name,
symname + (TARGET_UNDERSCORE ? 1 : 0)) != 0)
{
/* Not the name we're looking for */
continue;
}
/* Fall through. */
- case 1:
+ case 1:
/* MSVC mode: the lexically second symbol (or
drop through from the above). */
{
Intel puts the two adjacent, but Alpha (at
least) spreads them out. */
- section->comdat =
+ section->comdat =
bfd_alloc (abfd, sizeof (struct bfd_comdat_info));
if (section->comdat == NULL)
abort ();
. struct bfd_link_info *info,
. bfd *abfd,
. const char *name,
-. flagword flags,
+. flagword flags,
. asection *section,
. bfd_vma value,
. const char *string,
. boolean copy,
-. boolean collect,
+. boolean collect,
. struct bfd_link_hash_entry **hashp));
.
. boolean (*_bfd_coff_link_output_has_begun) PARAMS ((
if (bfd_read ((PTR) & dst, 1, bfd_coff_relsz (abfd), abfd)
!= bfd_coff_relsz (abfd))
return;
-
+
coff_swap_reloc_in (abfd, &dst, &n);
bfd_seek (abfd, oldpos, 0);
section->reloc_count =
}
#endif
-#ifdef ARM
+#ifdef ARM
/* Set the flags field from the COFF header read in */
if (! _bfd_coff_arm_set_private_flags (abfd, internal_f->f_flags))
coff->flags = 0;
#endif
-
+
#ifdef COFF_WITH_PE
/* FIXME: I'm not sure this is ever executed, since peicode.h
defines coff_mkobject_hook. */
case PPCMAGIC:
arch = bfd_arch_powerpc;
machine = 0; /* what does this mean? (krk) */
- break;
+ break;
#endif
#ifdef I386MAGIC
case I386MAGIC:
buf = (bfd_byte *) bfd_malloc (bfd_coff_symesz (abfd));
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
- || (bfd_read (buf, 1, bfd_coff_symesz (abfd), abfd)
+ || (bfd_read (buf, 1, bfd_coff_symesz (abfd), abfd)
!= bfd_coff_symesz (abfd)))
{
free (buf);
default:
arch = bfd_arch_obscure;
(*_bfd_error_handler)
- (_("Unrecognized TI COFF target id '0x%x'"),
+ (_("Unrecognized TI COFF target id '0x%x'"),
internal_f->f_target_id);
break;
}
place). This is a bad thing,'cause the symbols attached
to the output bfd are indexed, so that the relocation
entries know which symbol index they point to. So we
- have to look up the output symbol here. */
+ have to look up the output symbol here. */
if (q->sym_ptr_ptr[0]->the_bfd != abfd)
{
{
if (APCS_26_FLAG (abfd))
* flagsp |= F_APCS26;
-
+
if (APCS_FLOAT_FLAG (abfd))
* flagsp |= F_APCS_FLOAT;
-
+
if (PIC_FLAG (abfd))
* flagsp |= F_PIC;
}
case bfd_arch_i386:
*magicp = I386MAGIC;
#ifdef LYNXOS
- /* Just overwrite the usual value if we're doing Lynx. */
+ /* Just overwrite the usual value if we're doing Lynx. */
*magicp = LYNXCOFFMAGIC;
#endif
return true;
#endif
#endif
#ifdef LYNXOS
- /* Just overwrite the usual value if we're doing Lynx. */
+ /* Just overwrite the usual value if we're doing Lynx. */
*magicp = LYNXCOFFMAGIC;
#endif
return true;
case bfd_arch_sparc:
*magicp = SPARCMAGIC;
#ifdef LYNXOS
- /* Just overwrite the usual value if we're doing Lynx. */
+ /* Just overwrite the usual value if we're doing Lynx. */
*magicp = LYNXCOFFMAGIC;
#endif
return true;
#ifdef XCOFF64
if (bfd_get_mach (abfd) == bfd_mach_ppc_620
&& !strncmp (abfd->xvec->name,"aix", 3))
- *magicp = U803XTOCMAGIC;
+ *magicp = U803XTOCMAGIC;
else
#else
- *magicp = U802TOCMAGIC;
+ *magicp = U802TOCMAGIC;
#endif
return true;
break;
* magicp = MCOREMAGIC;
return true;
#endif
-
+
#ifdef W65MAGIC
case bfd_arch_w65:
*magicp = W65MAGIC;
return false;
}
-
static boolean
coff_set_arch_mach (abfd, arch, machine)
bfd * abfd;
coff_set_flags (abfd, &dummy1, &dummy2) != true)
return false; /* We can't represent this type */
- return true; /* We're easy ... */
+ return true; /* We're easy ... */
}
#ifdef COFF_IMAGE_WITH_PE
#endif /* COFF_IMAGE_WITH_PE */
-/* Calculate the file position for each section. */
+/* Calculate the file position for each section. */
#ifndef I960
#define ALIGN_SECTIONS_IN_FILE
#ifdef COFF_IMAGE_WITH_PE
int page_size;
- if (coff_data (abfd)->link_info)
+ if (coff_data (abfd)->link_info)
{
page_size = pe_data (abfd)->pe_opthdr.FileAlignment;
}
/* Align the sections in the file to the same boundary on
which they are aligned in virtual memory. I960 doesn't
do this (FIXME) so we can stay in sync with Intel. 960
- doesn't yet page from files... */
+ doesn't yet page from files... */
#ifdef ALIGN_SECTIONS_IN_FILE
if ((abfd->flags & EXEC_P) != 0)
{
section.s_paddr = current->lma;
section.s_size = current->_raw_size;
#ifdef coff_get_section_load_page
- section.s_page = coff_get_section_load_page (current);
+ section.s_page = coff_get_section_load_page (current);
#endif
#ifdef COFF_WITH_PE
? 1 << current->alignment_power
: 0);
#endif
-#ifdef TIC80COFF
+#ifdef TIC80COFF
/* TI COFF puts the alignment power in bits 8-11 of the flags */
section.s_flags |= (current->alignment_power & 0xF) << 8;
#endif
}
#endif
- /* OK, now set up the filehdr... */
+ /* OK, now set up the filehdr... */
/* Don't include the internal abs section in the section count */
coff_set_flags (abfd, &magic, &flags);
internal_f.f_magic = magic;
internal_f.f_flags |= flags;
- /* ...and the "opt"hdr... */
+ /* ...and the "opt"hdr... */
#ifdef A29K
#ifdef ULTRA3 /* NYU's machine */
#if defined(ARM)
#define __A_MAGIC_SET__
internal_a.magic = ZMAGIC;
-#endif
+#endif
#if defined(PPC_PE)
#define __A_MAGIC_SET__
#if defined MCORE_PE
#define __A_MAGIC_SET__
internal_a.magic = IMAGE_NT_OPTIONAL_HDR_MAGIC;
-#endif
+#endif
#if defined(I386)
#define __A_MAGIC_SET__
/* now write them */
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
return false;
-
+
{
char * buff;
bfd_size_type amount;
-
+
buff = bfd_malloc (bfd_coff_filhsz (abfd));
- if (buff == NULL)
+ if (buff == NULL)
return false;
-
+
coff_swap_filehdr_out (abfd, (PTR) & internal_f, (PTR) buff);
amount = bfd_write ((PTR) buff, 1, bfd_coff_filhsz (abfd), abfd);
-
+
free (buff);
-
+
if (amount != bfd_coff_filhsz (abfd))
return false;
}
-
+
if (abfd->flags & EXEC_P)
{
- /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR.
- include/coff/pe.h sets AOUTSZ == sizeof(PEAOUTHDR)) */
+ /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR.
+ include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)) */
char * buff;
bfd_size_type amount;
buff = bfd_malloc (bfd_coff_aoutsz (abfd));
- if (buff == NULL)
+ if (buff == NULL)
return false;
-
+
coff_swap_aouthdr_out (abfd, (PTR) & internal_a, (PTR) buff);
amount = bfd_write ((PTR) buff, 1, bfd_coff_aoutsz (abfd), abfd);
-
+
free (buff);
-
+
if (amount != bfd_coff_aoutsz (abfd))
return false;
}
to write a section which doesn't follow these assumptions. The
code has been tested on ISC 4.1 by me, and on SCO by Robert Lipe
<robertl@arnet.com> (Thanks!).
-
+
Gvran Uddeborg <gvran@uddeborg.pp.se> */
if (strcmp (section->name, _LIB) == 0)
#endif
/* Don't write out bss sections - one way to do this is to
- see if the filepos has not been set. */
+ see if the filepos has not been set. */
if (section->filepos == 0)
return true;
}
asect->lineno = lineno_cache;
- /* FIXME, free native_lineno here, or use alloca or something. */
+ /* FIXME, free native_lineno here, or use alloca or something. */
return true;
}
case COFF_SYMBOL_UNDEFINED:
dst->symbol.section = bfd_und_section_ptr;
dst->symbol.value = 0;
- break;
+ break;
case COFF_SYMBOL_PE_SECTION:
dst->symbol.flags |= BSF_EXPORT | BSF_SECTION_SYM;
#ifdef I960
case C_LEAFSTAT: /* static leaf procedure */
#endif
-#if defined ARM
+#if defined ARM
case C_THUMBSTAT: /* Thumb static */
case C_THUMBLABEL: /* Thumb label */
case C_THUMBSTATFUNC:/* Thumb static function */
/* NT uses 0x67 for a weak symbol, not C_ALIAS. */
case C_ALIAS: /* duplicate tag */
#endif
- /* New storage classes for TI COFF */
+ /* New storage classes for TI COFF */
#if defined(TIC80COFF) || defined(TICOFF)
case C_UEXT: /* Tentative external definition */
#endif
into a howto table vector; the 88k subtracts a number from the
@code{r_type} field and creates an addend field.
-
*/
#ifndef CALC_ADDEND
if (reloc_cache == NULL)
return false;
-
for (idx = 0; idx < asect->reloc_count; idx++)
{
struct internal_reloc dst;
arelent *tblptr = section->relocation;
unsigned int count = 0;
-
if (section->flags & SEC_CONSTRUCTOR)
{
/* this section has relocs made up by us, they are not in the
for (; count++ < section->reloc_count;)
*relptr++ = tblptr++;
-
}
*relptr = 0;
return section->reloc_count;
#define coff_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data
#endif
-#ifndef coff_bfd_copy_private_bfd_data
+#ifndef coff_bfd_copy_private_bfd_data
#define coff_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#endif
#define coff_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
#endif
-#ifndef coff_bfd_print_private_bfd_data
+#ifndef coff_bfd_print_private_bfd_data
#define coff_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
#endif
return bfd_coff_filhsz (abfd);
}
-
#ifndef NO_COFF_SYMBOLS
static void
memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN);
#endif
}
- in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value);
+ in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value);
in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum);
- if (sizeof(ext->e_type) == 2){
+ if (sizeof (ext->e_type) == 2){
in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type);
}
else {
}
bfd_h_put_32(abfd, in->n_value , (bfd_byte *) ext->e_value);
bfd_h_put_16(abfd, in->n_scnum , (bfd_byte *) ext->e_scnum);
- if (sizeof(ext->e_type) == 2)
+ if (sizeof (ext->e_type) == 2)
{
bfd_h_put_16(abfd, in->n_type , (bfd_byte *) ext->e_type);
}
case C_FILE:
if (ext->x_file.x_fname[0] == 0) {
in->x_file.x_n.x_zeroes = 0;
- in->x_file.x_n.x_offset =
+ in->x_file.x_n.x_offset =
bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset);
} else {
#if FILNMLEN != E_FILNMLEN
end: ;
/* the semicolon is because MSVC doesn't like labels at
- end of block. */
+ end of block. */
#ifdef COFF_ADJUST_AUX_IN_POST
COFF_ADJUST_AUX_IN_POST (abfd, ext1, type, class, indx, numaux, in1);
bfd_h_put_32(abfd, aouthdr_int->vid[1], (bfd_byte *) aouthdr_ext->vid + 4);
#endif
-
#ifdef RS6000COFF_C
#ifdef XCOFF64
aouthdr_int->o_toc = bfd_h_get_64(abfd, aouthdr_ext->o_toc);
#ifdef COFF_ADJUST_SCNHDR_IN_PRE
COFF_ADJUST_SCNHDR_IN_PRE (abfd, ext, in);
#endif
- memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof(scnhdr_int->s_name));
+ memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof (scnhdr_int->s_name));
scnhdr_int->s_vaddr =
GET_SCNHDR_VADDR (abfd, (bfd_byte *) scnhdr_ext->s_vaddr);
scnhdr_int->s_paddr =
#ifdef COFF_ADJUST_SCNHDR_OUT_PRE
COFF_ADJUST_SCNHDR_OUT_PRE (abfd, in, out);
#endif
- memcpy(scnhdr_ext->s_name, scnhdr_int->s_name, sizeof(scnhdr_int->s_name));
+ memcpy(scnhdr_ext->s_name, scnhdr_int->s_name, sizeof (scnhdr_int->s_name));
PUT_SCNHDR_VADDR (abfd, scnhdr_int->s_vaddr,
(bfd_byte *) scnhdr_ext->s_vaddr);
-
PUT_SCNHDR_PADDR (abfd, scnhdr_int->s_paddr,
(bfd_byte *) scnhdr_ext->s_paddr);
PUT_SCNHDR_SIZE (abfd, scnhdr_int->s_size,
PUTWORD(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc);
#else
if (scnhdr_int->s_nlnno <= MAX_SCNHDR_NLNNO)
- PUT_SCNHDR_NLNNO(abfd, scnhdr_int->s_nlnno,
+ PUT_SCNHDR_NLNNO(abfd, scnhdr_int->s_nlnno,
(bfd_byte *) scnhdr_ext->s_nlnno);
else
{
PUT_SCNHDR_NLNNO(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno);
}
if (scnhdr_int->s_nreloc <= MAX_SCNHDR_NRELOC)
- PUT_SCNHDR_NRELOC(abfd, scnhdr_int->s_nreloc,
+ PUT_SCNHDR_NRELOC(abfd, scnhdr_int->s_nreloc,
(bfd_byte *) scnhdr_ext->s_nreloc);
else
{