Contributed by Richard Henderson <rth@tamu.edu>.
This file is part of BFD, the Binary File Descriptor library.
Contributed by Richard Henderson <rth@tamu.edu>.
This file is part of BFD, the Binary File Descriptor library.
ret = (struct alpha_elf_link_hash_table *) bfd_zmalloc (amt);
if (ret == (struct alpha_elf_link_hash_table *) NULL)
ret = (struct alpha_elf_link_hash_table *) bfd_zmalloc (amt);
if (ret == (struct alpha_elf_link_hash_table *) NULL)
\f
/* Handle an Alpha specific section when reading an object file. This
is called when bfd_section_from_shdr finds a section with an unknown
\f
/* Handle an Alpha specific section when reading an object file. This
is called when bfd_section_from_shdr finds a section with an unknown
- if (! bfd_set_section_flags (abfd, newsect,
- (bfd_get_section_flags (abfd, newsect)
- | SEC_DEBUGGING)))
+ if (!bfd_set_section_flags (newsect,
+ bfd_section_flags (newsect) | SEC_DEBUGGING))
| (elf64_alpha_use_secureplt ? SEC_READONLY : 0));
s = bfd_make_section_anyway_with_flags (abfd, ".plt", flags);
elf_hash_table (info)->splt = s;
| (elf64_alpha_use_secureplt ? SEC_READONLY : 0));
s = bfd_make_section_anyway_with_flags (abfd, ".plt", flags);
elf_hash_table (info)->splt = s;
| SEC_LINKER_CREATED | SEC_READONLY);
s = bfd_make_section_anyway_with_flags (abfd, ".rela.plt", flags);
elf_hash_table (info)->srelplt = s;
| SEC_LINKER_CREATED | SEC_READONLY);
s = bfd_make_section_anyway_with_flags (abfd, ".rela.plt", flags);
elf_hash_table (info)->srelplt = s;
flags = SEC_ALLOC | SEC_LINKER_CREATED;
s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
elf_hash_table (info)->sgotplt = s;
flags = SEC_ALLOC | SEC_LINKER_CREATED;
s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
elf_hash_table (info)->sgotplt = s;
s = bfd_make_section_anyway_with_flags (abfd, ".rela.got", flags);
elf_hash_table (info)->srelgot = s;
if (s == NULL
s = bfd_make_section_anyway_with_flags (abfd, ".rela.got", flags);
elf_hash_table (info)->srelgot = s;
if (s == NULL
/* The symbolic header contains absolute file offsets and sizes to
read. */
#define READ(ptr, offset, count, size, type) \
/* The symbolic header contains absolute file offsets and sizes to
read. */
#define READ(ptr, offset, count, size, type) \
- bfd_size_type amt = (bfd_size_type) size * symhdr->count; \
- debug->ptr = (type) bfd_malloc (amt); \
- if (debug->ptr == NULL) \
+ size_t amt; \
+ debug->ptr = NULL; \
+ if (symhdr->count == 0) \
+ break; \
+ if (_bfd_mul_overflow (size, symhdr->count, &amt)) \
+ { \
+ bfd_set_error (bfd_error_file_too_big); \
+ goto error_return; \
+ } \
+ if (bfd_seek (abfd, symhdr->offset, SEEK_SET) != 0) \
- if (bfd_seek (abfd, (file_ptr) symhdr->offset, SEEK_SET) != 0 \
- || bfd_bread (debug->ptr, amt, abfd) != amt) \
+ debug->ptr = (type) _bfd_malloc_and_read (abfd, amt, amt); \
+ if (debug->ptr == NULL) \
READ (line, cbLineOffset, cbLine, sizeof (unsigned char), unsigned char *);
READ (external_dnr, cbDnOffset, idnMax, swap->external_dnr_size, void *);
READ (line, cbLineOffset, cbLine, sizeof (unsigned char), unsigned char *);
READ (external_dnr, cbDnOffset, idnMax, swap->external_dnr_size, void *);
if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset,
filename_ptr, functionname_ptr,
line_ptr, discriminator_ptr,
if (_bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, offset,
filename_ptr, functionname_ptr,
line_ptr, discriminator_ptr,
if (strcmp (name, ".text") == 0)
h->esym.asym.sc = scText;
if (strcmp (name, ".text") == 0)
h->esym.asym.sc = scText;
amt = sizeof (struct alpha_elf_got_entry);
gotent = (struct alpha_elf_got_entry *) bfd_alloc (abfd, amt);
amt = sizeof (struct alpha_elf_got_entry);
gotent = (struct alpha_elf_got_entry *) bfd_alloc (abfd, amt);
Elf_Internal_Shdr *symtab_hdr;
struct alpha_elf_link_hash_entry **sym_hashes;
const Elf_Internal_Rela *rel, *relend;
Elf_Internal_Shdr *symtab_hdr;
struct alpha_elf_link_hash_entry **sym_hashes;
const Elf_Internal_Rela *rel, *relend;
loaded into memory, we need a RELATIVE reloc. */
sreloc->size += sizeof (Elf64_External_Rela);
if (sec->flags & SEC_READONLY)
loaded into memory, we need a RELATIVE reloc. */
sreloc->size += sizeof (Elf64_External_Rela);
if (sec->flags & SEC_READONLY)
- info->flags |= DF_TEXTREL;
+ {
+ info->flags |= DF_TEXTREL;
+ info->callbacks->minfo
+ (_("%pB: dynamic relocation against `%pT' in "
+ "read-only section `%pA'\n"),
+ sec->owner, h->root.root.root.string, sec);
+ }
- if (relent->reltext)
- info->flags |= DT_TEXTREL;
+ if ((sec->flags & SEC_READONLY) != 0)
+ {
+ info->flags |= DT_TEXTREL;
+ info->callbacks->minfo
+ (_("%pB: dynamic relocation against `%pT' in "
+ "read-only section `%pA'\n"),
+ sec->owner, h->root.root.root.string, sec);
+ }
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
}
(*info->callbacks->reloc_overflow)
(info, (h ? &h->root.root : NULL), name, howto->name,
}
(*info->callbacks->reloc_overflow)
(info, (h ? &h->root.root : NULL), name, howto->name,
/* A few constants that determine how the .plt section is set up. */
#define elf_backend_want_got_plt 0
#define elf_backend_plt_readonly 0
/* A few constants that determine how the .plt section is set up. */
#define elf_backend_want_got_plt 0
#define elf_backend_plt_readonly 0
"FreeBSD" label in the ELF header. So we put this label on all
executables and (for simplicity) also all other object files. */
"FreeBSD" label in the ELF header. So we put this label on all
executables and (for simplicity) also all other object files. */
/* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */
memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
#endif
/* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */
memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
#endif
-#undef elf_backend_post_process_headers
-#define elf_backend_post_process_headers \
- elf64_alpha_fbsd_post_process_headers
+#undef elf_backend_init_file_header
+#define elf_backend_init_file_header \
+ elf64_alpha_fbsd_init_file_header