diff options
author | Alan Modra <amodra@gmail.com> | 2002-07-10 04:59:42 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-07-10 04:59:42 +0000 |
commit | 0594c12d8e99dccd69fc9c771ab6c0415300b5d9 (patch) | |
tree | f7800e4d825f8db111afb923204548904614171a /bfd | |
parent | b851d07bfd7deab3fd46ac64b1c5d9b56f218676 (diff) | |
download | gdb-0594c12d8e99dccd69fc9c771ab6c0415300b5d9.zip gdb-0594c12d8e99dccd69fc9c771ab6c0415300b5d9.tar.gz gdb-0594c12d8e99dccd69fc9c771ab6c0415300b5d9.tar.bz2 |
* elf.c: (assign_section_numbers) Set sh_entsize for .stab only
when not already set.
* elf64-sparc.c: (sparc64_elf_fake_sections): New function.
(elf_backend_fake_sections): Define.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf.c | 5 | ||||
-rw-r--r-- | bfd/elf64-sparc.c | 26 |
3 files changed, 36 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3790881..0c65627 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2002-07-10 Marco Walther <Marco.Walther@sun.com> + + * elf.c: (assign_section_numbers) Set sh_entsize for .stab only + when not already set. + * elf64-sparc.c: (sparc64_elf_fake_sections): New function. + (elf_backend_fake_sections): Define. + 2002-07-10 Alan Modra <amodra@bigpond.net.au> * merge.c (_bfd_merge_section): Remove redundant output_section check. @@ -2760,8 +2760,9 @@ assign_section_numbers (abfd) elf_section_data (s)->this_hdr.sh_link = d->this_idx; /* This is a .stab section. */ - elf_section_data (s)->this_hdr.sh_entsize = - 4 + 2 * bfd_get_arch_size (abfd) / 8; + if (elf_section_data (s)->this_hdr.sh_entsize == 0) + elf_section_data (s)->this_hdr.sh_entsize + = 4 + 2 * bfd_get_arch_size (abfd) / 8; } } break; diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 0ae3813..7dd51f7 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -72,6 +72,9 @@ static void sparc64_elf_symbol_processing static boolean sparc64_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +static boolean sparc64_elf_fake_sections + PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); + static const char *sparc64_elf_print_symbol_all PARAMS ((bfd *, PTR, asymbol *)); static boolean sparc64_elf_relax_section @@ -2995,6 +2998,27 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) } return true; } + +/* MARCO: Set the correct entry size for the .stab section. */ + +static boolean +sparc64_elf_fake_sections (abfd, hdr, sec) + bfd *abfd ATTRIBUTE_UNUSED; + Elf32_Internal_Shdr *hdr ATTRIBUTE_UNUSED; + asection *sec; +{ + const char *name; + + name = bfd_get_section_name (abfd, sec); + + if (strcmp (name, ".stab") == 0) + { + /* Even in the 64bit case the stab entries are only 12 bytes long. */ + elf_section_data (sec)->this_hdr.sh_entsize = 12; + } + + return true; +} /* Print a STT_REGISTER symbol to file FILE. */ @@ -3132,6 +3156,8 @@ const struct elf_size_info sparc64_elf_size_info = sparc64_elf_output_arch_syms #define bfd_elf64_bfd_merge_private_bfd_data \ sparc64_elf_merge_private_bfd_data +#define elf_backend_fake_sections \ + sparc64_elf_fake_sections #define elf_backend_size_info \ sparc64_elf_size_info |