* libbfd.h: Regnerate.
* elf32-cris.c: Add missing semicolon to BFD_ASSERTs.
* elf32-frv.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-ppc.c: Likewise.
* elf64-hppa.c: Likewise.
* elfxx-ia64.c: Likewise.
* opncls.c: Likewise.
2004-10-10 Alan Modra <amodra@bigpond.net.au>
+ * libbfd-in.h (BFD_ASSERT, BFD_FAIL): Wrap macro body in do while.
+ * libbfd.h: Regnerate.
+ * elf32-cris.c: Add missing semicolon to BFD_ASSERTs.
+ * elf32-frv.c: Likewise.
+ * elf32-m32r.c: Likewise.
+ * elf32-ppc.c: Likewise.
+ * elf64-hppa.c: Likewise.
+ * elfxx-ia64.c: Likewise.
+ * opncls.c: Likewise.
+
+2004-10-10 Alan Modra <amodra@bigpond.net.au>
+
* elf-bfd.h (struct eh_frame_hdr_info): Add offsets_adjusted.
* elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Adjust
offsets stored in struct eh_cie_fde entries before doing other
{
FILE *file = (FILE *) ptr;
- BFD_ASSERT (abfd != NULL && ptr != NULL)
+ BFD_ASSERT (abfd != NULL && ptr != NULL);
_bfd_elf_print_private_bfd_data (abfd, ptr);
/* Obtain the address of the entry in HT associated with the SYMNDXth
local symbol of the input bfd ABFD, plus the addend, creating a new
- entry if none existed. */
+ entry if none existed. */
inline static struct frvfdpic_relocs_info *
frvfdpic_relocs_info_for_local (struct htab *ht,
bfd *abfd,
asection *sec,
Elf_Internal_Sym *sym,
bfd_vma addend)
-
+
{
bfd_vma fd_lazy_rel_offset = (bfd_vma)-1;
int dynindx = -1;
->output_section->vma
+ frvfdpic_got_section (info)->output_offset,
R_FRV_32, idx, ad, entry);
-
+
bfd_put_32 (output_bfd, ad,
frvfdpic_got_section (info)->contents
+ frvfdpic_got_initial_offset (info)
{
int reloc, idx;
bfd_vma ad = 0;
-
+
if (! (entry->symndx == -1
&& entry->d.h->root.type == bfd_link_hash_undefweak
&& FRVFDPIC_SYM_LOCAL (info, entry->d.h)))
{
if (ad)
return FALSE;
-
+
fd_lazy_rel_offset = ofst;
/* A function descriptor used for lazy or local resolving is
lowword = entry->lzplt_entry + 4
+ frvfdpic_plt_section (info)->output_offset
+ frvfdpic_plt_section (info)->output_section->vma;
- highword = _frvfdpic_osec_to_segment
+ highword = _frvfdpic_osec_to_segment
(output_bfd, frvfdpic_plt_section (info)->output_section);
}
else
relocation = picrel->got_entry;
check_segment[0] = check_segment[1] = got_segment;
break;
-
+
case R_FRV_FUNCDESC_GOT12:
case R_FRV_FUNCDESC_GOTHI:
case R_FRV_FUNCDESC_GOTLO:
relocation = picrel->fdgot_entry;
check_segment[0] = check_segment[1] = got_segment;
break;
-
+
case R_FRV_GOTOFFHI:
case R_FRV_GOTOFF12:
case R_FRV_GOTOFFLO:
if (! IS_FDPIC (output_bfd) || ! picrel->plt)
break;
/* Fall through. */
-
+
/* When referencing a GOT entry, a function descriptor or a
PLT, we don't want the addend to apply to the reference,
but rather to the referenced symbol. The actual entry
/* Note that we only want GOTOFFHI, not GOTOFFLO or GOTOFF12
here, since we do want to apply the addend to the others.
Note that we've applied the addend to GOTOFFHI before we
- shifted it right. */
+ shifted it right. */
case R_FRV_GOTOFFHI:
relocation -= rel->r_addend;
break;
odd = cur + got;
got += 4;
}
-
+
/* Compute the tentative boundaries of this range. */
gad->max = cur + got;
gad->min = fdcur - fd;
_frvfdpic_get_got_entry (struct _frvfdpic_dynamic_got_alloc_data *gad)
{
bfd_signed_vma ret;
-
+
if (gad->odd)
{
/* If there was an odd word left behind, use it. */
}
else if (entry->privfd)
entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->gothilo);
-
+
return 1;
}
}
else
{
- BFD_ASSERT (dinfo->gothilo.fdplt)
+ BFD_ASSERT (dinfo->gothilo.fdplt);
entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->gothilo);
dinfo->gothilo.fdplt -= 8;
}
== FRVFDPIC_LZPLT_RESOLV_LOC)
dinfo->g.lzplt += 4;
}
-
+
return 1;
-}
+}
/* Follow indirect and warning hash entries so that each got entry
points to the final symbol definition. P must point to a pointer
if (frvfdpic_got_section (info)->contents == NULL)
return FALSE;
}
-
+
if (elf_hash_table (info)->dynamic_sections_created)
/* Subtract the number of lzplt entries, since those will generate
relocations in the pltrel section. */
if (frvfdpic_gotfixup_section (info)->contents == NULL)
return FALSE;
}
-
+
if (elf_hash_table (info)->dynamic_sections_created)
{
frvfdpic_pltrel_section (info)->size =
return FALSE;
}
}
-
+
/* Add 4 bytes for every block of at most 65535 lazy PLT entries,
such that there's room for the additional instruction needed to
call the resolver. Since _frvfdpic_assign_got_entries didn't
picrel = NULL;
break;
}
-
+
switch (ELF32_R_TYPE (rel->r_info))
{
case R_FRV_LABEL24:
if (IS_FDPIC (abfd))
picrel->call = 1;
break;
-
+
case R_FRV_FUNCDESC_VALUE:
picrel->relocsfdv++;
if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
picrel->relocs32++;
break;
-
+
case R_FRV_GOT12:
picrel->got12 = 1;
break;
-
+
case R_FRV_GOTHI:
case R_FRV_GOTLO:
picrel->gothilo = 1;
case R_FRV_FUNCDESC_GOT12:
picrel->fdgot12 = 1;
break;
-
+
case R_FRV_FUNCDESC_GOTHI:
case R_FRV_FUNCDESC_GOTLO:
picrel->fdgothilo = 1;
break;
-
+
case R_FRV_GOTOFF12:
case R_FRV_GOTOFFHI:
case R_FRV_GOTOFFLO:
picrel->gotoff = 1;
break;
-
+
case R_FRV_FUNCDESC_GOTOFF12:
picrel->fdgoff12 = 1;
break;
-
+
case R_FRV_FUNCDESC_GOTOFFHI:
case R_FRV_FUNCDESC_GOTOFFLO:
picrel->fdgoffhilo = 1;
break;
-
+
case R_FRV_FUNCDESC:
picrel->fd = 1;
picrel->relocsfd++;
break;
-
+
/* This relocation describes the C++ object vtable hierarchy.
Reconstruct it for later use during GC. */
case R_FRV_GNU_VTINHERIT:
if (flags & EF_FRV_FDPIC)
fprintf (file, " -mfdpic");
-
+
if (flags & EF_FRV_NON_PIC_RELOCS)
fprintf (file, " non-pic relocations");
unsigned int r_type;
r_type = ELF32_R_TYPE (dst->r_info);
- BFD_ASSERT (ELF32_R_TYPE(dst->r_info) <= (unsigned int) R_M32R_GNU_VTENTRY)
+ BFD_ASSERT (ELF32_R_TYPE(dst->r_info) <= (unsigned int) R_M32R_GNU_VTENTRY);
cache_ptr->howto = &m32r_elf_howto_table[r_type];
}
case R_M32R_GOTOFF:
/* Relocation is relative to the start of the global offset
table (for ld24 rx, #uimm24). eg access at label+addend
-
+
ld24 rx. #label@GOTOFF + addend
sub rx, r12. */
{
FILE * file = (FILE *) ptr;
- BFD_ASSERT (abfd != NULL && ptr != NULL)
+ BFD_ASSERT (abfd != NULL && ptr != NULL);
_bfd_elf_print_private_bfd_data (abfd, ptr);
BFD_ASSERT (sec != NULL);
BFD_ASSERT (bfd_is_und_section (sec)
|| strcmp (bfd_get_section_name (abfd, sec), ".got") == 0
- || strcmp (bfd_get_section_name (abfd, sec), ".cgot") == 0)
+ || strcmp (bfd_get_section_name (abfd, sec), ".cgot") == 0);
addend -= sec->output_section->vma + sec->output_offset + 0x8000;
break;
the original values (in elf64_hppa_link_output_symbol_hook). */
if (dyn_h && dyn_h->want_opd)
{
- BFD_ASSERT (sopd != NULL)
+ BFD_ASSERT (sopd != NULL);
/* Save away the original value and section index so that we
can restore them later. */
Elf_Internal_Rela rel;
bfd_byte *loc;
- BFD_ASSERT (splt != NULL && spltrel != NULL)
+ BFD_ASSERT (splt != NULL && spltrel != NULL);
/* We do not actually care about the value in the PLT entry
if we are creating a shared library and the symbol is
int insn;
unsigned int max_offset;
- BFD_ASSERT (stub != NULL)
+ BFD_ASSERT (stub != NULL);
/* Install the generic stub template.
location of interest is just "sym". */
if (symtype == STT_SECTION)
toff += irel->r_addend;
-
+
toff = _bfd_merged_section_offset (abfd, &tsec,
elf_section_data (tsec)->sec_info,
toff);
enough that the data segment moves, which will change the GP.
Reset the GP so that we re-calculate next round. We need to
do this at the _beginning_ of the next round; now will not do. */
-
+
/* Clean up and go home. */
while (fixups)
{
if (!pltoff)
return FALSE;
}
-
+
dyn_i->want_pltoff = 1;
}
if ((need_entry & NEED_DYNREL) && (sec->flags & SEC_ALLOC))
dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
if (dyn_i->want_fptr)
{
- BFD_ASSERT (h == NULL || h->dynindx == -1)
+ BFD_ASSERT (h == NULL || h->dynindx == -1);
if (!undef_weak_ref)
value = set_fptr_entry (output_bfd, info, dyn_i, value);
dynindx = -1;
case R_IA64_PCREL64I:
/* The PCREL21BI reloc is specifically not intended for use with
dynamic relocs. PCREL21F and PCREL21M are used for speculation
- fixup code, and thus probably ought not be dynamic. The
+ fixup code, and thus probably ought not be dynamic. The
PCREL22 and PCREL64I relocs aren't emitted as dynamic relocs. */
if (dynamic_symbol_p)
{
(const char*,int);
#define BFD_ASSERT(x) \
- { if (!(x)) bfd_assert(__FILE__,__LINE__); }
+ do { if (!(x)) bfd_assert(__FILE__,__LINE__); } while (0)
#define BFD_FAIL() \
- { bfd_assert(__FILE__,__LINE__); }
+ do { bfd_assert(__FILE__,__LINE__); } while (0)
extern void _bfd_abort
(const char *, int, const char *) ATTRIBUTE_NORETURN;
(const char*,int);
#define BFD_ASSERT(x) \
- { if (!(x)) bfd_assert(__FILE__,__LINE__); }
+ do { if (!(x)) bfd_assert(__FILE__,__LINE__); } while (0)
#define BFD_FAIL() \
- { bfd_assert(__FILE__,__LINE__); }
+ do { bfd_assert(__FILE__,__LINE__); } while (0)
extern void _bfd_abort
(const char *, int, const char *) ATTRIBUTE_NORETURN;
}
-/*
- GNU Extension: separate debug-info files
-
+/*
+ GNU Extension: separate debug-info files
+
The idea here is that a special section called .gnu_debuglink might be
embedded in a binary file, which indicates that some *other* file
contains the real debugging information. This special section contains a
RETURNS
Return the updated CRC32 value.
-*/
+*/
unsigned long
bfd_calc_gnu_debuglink_crc32 (unsigned long crc,
return NULL;
}
BFD_ASSERT (strlen (dir) != 0);
-
+
/* Strip off filename part. */
for (i = strlen (dir) - 1; i >= 0; i--)
if (IS_DIR_SEPARATOR (dir[i]))
break;
dir[i + 1] = '\0';
- BFD_ASSERT (dir[i] == '/' || dir[0] == '\0')
+ BFD_ASSERT (dir[i] == '/' || dir[0] == '\0');
debugfile = malloc (strlen (debug_file_directory) + 1
+ strlen (dir)
+ strlen (".debug/")
- + strlen (basename)
+ + strlen (basename)
+ 1);
if (debugfile == NULL)
{
RETURNS
A pointer to the new section is returned if all is ok. Otherwise <<NULL>> is
- returned and bfd_error is set.
+ returned and bfd_error is set.
*/
asection *
/* Strip off any path components in filename. */
filename = lbasename (filename);
-
+
sect = bfd_get_section_by_name (abfd, GNU_DEBUGLINK);
if (sect)
{
/* XXX Should we delete the section from the bfd ? */
return NULL;
-
+
debuglink_size = strlen (filename) + 1;
debuglink_size += 3;
debuglink_size &= ~3;
if (! bfd_set_section_size (abfd, sect, debuglink_size))
/* XXX Should we delete the section from the bfd ? */
return NULL;
-
+
return sect;
}
RETURNS
<<TRUE>> is returned if all is ok. Otherwise <<FALSE>> is returned
- and bfd_error is set.
+ and bfd_error is set.
*/
bfd_boolean
/* Strip off any path components in filename,
now that we no longer need them. */
filename = lbasename (filename);
-
+
debuglink_size = strlen (filename) + 1;
debuglink_size += 3;
debuglink_size &= ~3;