aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>1998-04-22 05:13:54 +0000
committerTom Tromey <tromey@redhat.com>1998-04-22 05:13:54 +0000
commit53d3ce37d4d65d2df72ec3c96e292adb1759d03e (patch)
tree92f307eadb5c78c77a8ee3f84aa582370628fe51 /bfd/elfcode.h
parent6bf191bf4d7018ecb2e4d68fd4f5b768162c0a7e (diff)
downloadgdb-53d3ce37d4d65d2df72ec3c96e292adb1759d03e.zip
gdb-53d3ce37d4d65d2df72ec3c96e292adb1759d03e.tar.gz
gdb-53d3ce37d4d65d2df72ec3c96e292adb1759d03e.tar.bz2
* Many files: Added gettext invocations around user-visible
strings. * libbfd-in.h: Added gettext includes and defines. * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY, HAVE_LC_MESSAGES): Define. * configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and po/Makefile. * Makefile.am (SUBDIRS): Added po. (POTFILES): New macro. (po/POTFILES.in): New target. (SOURCE_HFILES): New macro. (HFILES): Use it. * po/Make-in, po/POTFILES.in, po/bfd.pot: New files.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index fe85d69..60ac0ea 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -1,5 +1,5 @@
/* ELF executable support for BFD.
- Copyright 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -142,7 +142,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define LOG_FILE_ALIGN 2
#endif
-/* Forward declarations of static functions */
+/* Static functions */
static void elf_swap_ehdr_in
PARAMS ((bfd *, const Elf_External_Ehdr *, Elf_Internal_Ehdr *));
@@ -162,6 +162,8 @@ static boolean elf_slurp_reloc_table
static void write_relocs PARAMS ((bfd *, asection *, PTR));
+static boolean elf_file_p PARAMS ((Elf_External_Ehdr *));
+
#ifdef DEBUG
static void elf_debug_section PARAMS ((int, Elf_Internal_Shdr *));
static void elf_debug_file PARAMS ((Elf_Internal_Ehdr *));
@@ -174,11 +176,15 @@ static char *elf_symbol_flags PARAMS ((flagword));
can be handled by explicitly specifying 32 bits or "the long type". */
#if ARCH_SIZE == 64
#define put_word bfd_h_put_64
+#define put_signed_word bfd_h_put_signed_64
#define get_word bfd_h_get_64
+#define get_signed_word bfd_h_get_signed_64
#endif
#if ARCH_SIZE == 32
#define put_word bfd_h_put_32
+#define put_signed_word bfd_h_put_signed_32
#define get_word bfd_h_get_32
+#define get_signed_word bfd_h_get_signed_32
#endif
/* Translate an ELF symbol in external format into an ELF symbol in internal
@@ -370,7 +376,7 @@ elf_swap_reloca_in (abfd, src, dst)
{
dst->r_offset = get_word (abfd, (bfd_byte *) src->r_offset);
dst->r_info = get_word (abfd, (bfd_byte *) src->r_info);
- dst->r_addend = get_word (abfd, (bfd_byte *) src->r_addend);
+ dst->r_addend = get_signed_word (abfd, (bfd_byte *) src->r_addend);
}
/* Translate an ELF reloc from internal format to external format. */
@@ -392,7 +398,7 @@ elf_swap_reloca_out (abfd, src, dst)
{
put_word (abfd, src->r_offset, dst->r_offset);
put_word (abfd, src->r_info, dst->r_info);
- put_word (abfd, src->r_addend, dst->r_addend);
+ put_signed_word (abfd, src->r_addend, dst->r_addend);
}
INLINE void
@@ -924,7 +930,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
{
Elf_Internal_Shdr *hdr;
Elf_Internal_Shdr *verhdr;
- long symcount; /* Number of external ELF symbols */
+ unsigned long symcount; /* Number of external ELF symbols */
elf_symbol_type *sym; /* Pointer to current bfd symbol */
elf_symbol_type *symbase; /* Buffer for generated bfd symbols */
Elf_Internal_Sym i_sym;
@@ -972,7 +978,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
sym = symbase = NULL;
else
{
- long i;
+ unsigned long i;
if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) == -1)
return -1;
@@ -999,7 +1005,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
&& verhdr->sh_size / sizeof (Elf_External_Versym) != symcount)
{
(*_bfd_error_handler)
- ("%s: version count (%ld) does not match symbol count (%ld)",
+ (_("%s: version count (%ld) does not match symbol count (%ld)"),
abfd->filename,
(long) (verhdr->sh_size / sizeof (Elf_External_Versym)),
symcount);
@@ -1071,7 +1077,10 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
else
sym->symbol.section = bfd_abs_section_ptr;
- sym->symbol.value -= sym->symbol.section->vma;
+ /* If this is a relocateable file, then the symbol value is
+ already section relative. */
+ if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0)
+ sym->symbol.value -= sym->symbol.section->vma;
switch (ELF_ST_BIND (i_sym.st_info))
{