/* Support for the generic parts of most COFF variants, for BFD.
- Copyright (C) 1990-2019 Free Software Foundation, Inc.
+ Copyright (C) 1990-2020 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
#ifdef COFF_LONG_SECTION_NAMES
|| CONST_STRNEQ (name, GNU_LINKONCE_WI)
|| CONST_STRNEQ (name, GNU_LINKONCE_WT)
+ /* FIXME: These definitions ought to be in a header file. */
+#define GNU_DEBUGLINK ".gnu_debuglink"
+#define GNU_DEBUGALTLINK ".gnu_debugaltlink"
+ || CONST_STRNEQ (name, GNU_DEBUGLINK)
+ || CONST_STRNEQ (name, GNU_DEBUGALTLINK)
#endif
|| CONST_STRNEQ (name, ".stab"))
is_dbg = TRUE;
for (i = 0; i < table_size; ++i)
{
- const char *secname = bfd_get_section_name (abfd, section);
+ const char *secname = bfd_section_name (section);
if (alignment_table[i].comparison_length == (unsigned int) -1
? strcmp (alignment_table[i].name, secname) == 0
#ifdef RS6000COFF_C
if (bfd_xcoff_text_align_power (abfd) != 0
- && strcmp (bfd_get_section_name (abfd, section), ".text") == 0)
+ && strcmp (bfd_section_name (section), ".text") == 0)
section->alignment_power = bfd_xcoff_text_align_power (abfd);
else if (bfd_xcoff_data_align_power (abfd) != 0
- && strcmp (bfd_get_section_name (abfd, section), ".data") == 0)
+ && strcmp (bfd_section_name (section), ".data") == 0)
section->alignment_power = bfd_xcoff_data_align_power (abfd);
else
{
int i;
for (i = 0; i < XCOFF_DWSECT_NBR_NAMES; i++)
- if (strcmp (bfd_get_section_name (abfd, section),
+ if (strcmp (bfd_section_name (section),
xcoff_dwsect_names[i].name) == 0)
{
section->alignment_power = 0;
case I386PTXMAGIC:
case I386AIXMAGIC: /* Danbury PS/2 AIX C Compiler. */
case LYNXCOFFMAGIC:
+ case I386_APPLE_MAGIC:
+ case I386_FREEBSD_MAGIC:
+ case I386_LINUX_MAGIC:
+ case I386_NETBSD_MAGIC:
arch = bfd_arch_i386;
break;
#endif
#ifdef AMD64MAGIC
case AMD64MAGIC:
+ case AMD64_APPLE_MAGIC:
+ case AMD64_FREEBSD_MAGIC:
+ case AMD64_LINUX_MAGIC:
+ case AMD64_NETBSD_MAGIC:
arch = bfd_arch_i386;
machine = bfd_mach_x86_64;
break;
arch = bfd_arch_z80;
switch (internal_f->f_flags & F_MACHMASK)
{
- case 0:
case bfd_mach_z80strict << 12:
case bfd_mach_z80 << 12:
case bfd_mach_z80full << 12:
case bfd_mach_r800 << 12:
+ case bfd_mach_gbz80 << 12:
+ case bfd_mach_z180 << 12:
+ case bfd_mach_ez80_z80 << 12:
+ case bfd_mach_ez80_adl << 12:
machine = ((unsigned)internal_f->f_flags & F_MACHMASK) >> 12;
break;
default:
break;
#endif
-#ifdef TIC80_ARCH_MAGIC
- case TIC80_ARCH_MAGIC:
- arch = bfd_arch_tic80;
- break;
-#endif
-
#ifdef MCOREMAGIC
case MCOREMAGIC:
arch = bfd_arch_mcore;
*magicp = Z80MAGIC;
switch (bfd_get_mach (abfd))
{
- case 0:
case bfd_mach_z80strict:
case bfd_mach_z80:
case bfd_mach_z80full:
case bfd_mach_r800:
+ case bfd_mach_gbz80:
+ case bfd_mach_z180:
+ case bfd_mach_ez80_z80:
+ case bfd_mach_ez80_adl:
*flagsp = bfd_get_mach (abfd) << 12;
break;
default:
return TRUE;
#endif
-#ifdef TIC80_ARCH_MAGIC
- case bfd_arch_tic80:
- *magicp = TIC80_ARCH_MAGIC;
- return TRUE;
-#endif
-
#ifdef ARMMAGIC
case bfd_arch_arm:
#ifdef ARM_WINCE
/* Calculate the file position for each section. */
#define ALIGN_SECTIONS_IN_FILE
-#if defined(TIC80COFF) || defined(TICOFF)
+#ifdef TICOFF
#undef ALIGN_SECTIONS_IN_FILE
#endif
incremented in coff_set_section_contents. This is right for
SVR3.2. */
if (strcmp (current->name, _LIB) == 0)
- (void) bfd_set_section_vma (abfd, current, 0);
+ bfd_set_section_vma (current, 0);
#endif
#ifdef ALIGN_SECTIONS_IN_FILE
but it doesn't hurt to set it internally. */
internal_f.f_target_id = TI_TARGET_ID;
#endif
-#ifdef TIC80_TARGET_ID
- internal_f.f_target_id = TIC80_TARGET_ID;
-#endif
/* FIXME, should do something about the other byte orders and
architectures. */
internal_a.magic = TICOFF_AOUT_MAGIC;
#define __A_MAGIC_SET__
#endif
-#ifdef TIC80COFF
- internal_a.magic = TIC80_ARCH_MAGIC;
-#define __A_MAGIC_SET__
-#endif /* TIC80 */
#if defined(ARM)
#define __A_MAGIC_SET__
if (text_sec != NULL)
{
internal_a.o_sntext = text_sec->target_index;
- internal_a.o_algntext = bfd_get_section_alignment (abfd, text_sec);
+ internal_a.o_algntext = bfd_section_alignment (text_sec);
}
else
{
if (data_sec != NULL)
{
internal_a.o_sndata = data_sec->target_index;
- internal_a.o_algndata = bfd_get_section_alignment (abfd, data_sec);
+ internal_a.o_algndata = bfd_section_alignment (data_sec);
}
else
{
PR 17521: file: 078-10659-0.004. */
continue;
else
- cache_ptr->u.offset = (dst.l_addr.l_paddr
- - bfd_section_vma (abfd, asect));
+ cache_ptr->u.offset = dst.l_addr.l_paddr - bfd_section_vma (asect);
cache_ptr++;
}
case C_ALIAS: /* Duplicate tag. */
#endif
/* New storage classes for TI COFF. */
-#if defined(TIC80COFF) || defined(TICOFF)
+#ifdef TICOFF
case C_UEXT: /* Tentative external definition. */
#endif
case C_EXTLAB: /* External load time label. */
obj_symbols (abfd) = cached_area;
obj_raw_syments (abfd) = native_symbols;
- bfd_get_symcount (abfd) = number_of_symbols;
+ abfd->symcount = number_of_symbols;
obj_convert (abfd) = table_ptr;
/* Slurp the line tables for each section too. */
{
name = _bfd_coff_internal_syment_name (abfd, syment, buf)
sec = coff_section_from_bfd_index (abfd, syment->n_scnum);
if (sec != NULL && name != NULL
- && (strcmp (bfd_get_section_name (abfd, sec), name) == 0))
+ && (strcmp (bfd_section_name (sec), name) == 0))
return COFF_SYMBOL_PE_SECTION;
}
#endif
#endif /* COFF_WITH_PE_BIGOBJ */
#ifndef coff_close_and_cleanup
-#define coff_close_and_cleanup _bfd_generic_close_and_cleanup
+#define coff_close_and_cleanup _bfd_coff_close_and_cleanup
#endif
#ifndef coff_bfd_free_cached_info
#define coff_bfd_is_group_section bfd_generic_is_group_section
#endif
+#ifndef coff_bfd_group_name
+#define coff_bfd_group_name bfd_coff_group_name
+#endif
+
#ifndef coff_bfd_discard_group
#define coff_bfd_discard_group bfd_generic_discard_group
#endif