X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf32-i370.c;h=9c5cfbdc9381a8963de1a52af77eb85933cd08f2;hb=6bba1048d63e0476b94b9934527defd81c590a13;hp=87e2189556e72ccecdeb540f876bd2c960d473de;hpb=ab96bf03fd98b6f68cd213ac81f52be3aca9c435;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index 87e2189556..9c5cfbdc93 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -1,6 +1,6 @@ /* i370-specific support for 32-bit ELF Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. + 2005, 2006, 2007 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. Hacked by Linas Vepstas for i370 linas@linas.org @@ -8,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -27,8 +27,8 @@ else is a wild card. In particular, don't expect shared libs or dynamic loading to work ... its never been tested. */ -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" @@ -267,6 +267,22 @@ i370_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return i370_elf_howto_table[ (int)i370_reloc ]; }; +static reloc_howto_type * +i370_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; + + for (i = 0; + i < sizeof (i370_elf_howto_raw) / sizeof (i370_elf_howto_raw[0]); + i++) + if (i370_elf_howto_raw[i].name != NULL + && strcasecmp (i370_elf_howto_raw[i].name, r_name) == 0) + return &i370_elf_howto_raw[i]; + + return NULL; +} + /* The name of the dynamic interpreter. This is put in the .interp section. */ @@ -445,7 +461,6 @@ i370_elf_adjust_dynamic_symbol (struct bfd_link_info *info, { bfd *dynobj = elf_hash_table (info)->dynobj; asection *s; - unsigned int power_of_two; #ifdef DEBUG fprintf (stderr, "i370_elf_adjust_dynamic_symbol called for %s\n", @@ -530,28 +545,7 @@ i370_elf_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_copy = 1; } - /* We need to figure out the alignment required for this symbol. I - have no idea how ELF linkers handle this. */ - power_of_two = bfd_log2 (h->size); - if (power_of_two > 4) - power_of_two = 4; - - /* Apply the required alignment. */ - s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two)); - if (power_of_two > bfd_get_section_alignment (dynobj, s)) - { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return FALSE; - } - - /* Define the symbol as being at this point in the section. */ - h->root.u.def.section = s; - h->root.u.def.value = s->size; - - /* Increment the section size to make room for the symbol. */ - s->size += h->size; - - return TRUE; + return _bfd_elf_adjust_dynamic_copy (h, s); } /* Increment the index of a dynamic symbol by a given amount. Called @@ -1417,16 +1411,6 @@ i370_elf_relocate_section (bfd *output_bfd, return ret; } - -static void -i370_elf_post_process_headers (bfd * abfd, - struct bfd_link_info * link_info ATTRIBUTE_UNUSED) -{ - Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form. */ - - i_ehdrp = elf_elfheader (abfd); - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX; -} #define TARGET_BIG_SYM bfd_elf32_i370_vec #define TARGET_BIG_NAME "elf32-i370" @@ -1436,12 +1420,15 @@ i370_elf_post_process_headers (bfd * abfd, #define ELF_MACHINE_ALT1 EM_I370_OLD #endif #define ELF_MAXPAGESIZE 0x1000 +#define ELF_OSABI ELFOSABI_LINUX + #define elf_info_to_howto i370_elf_info_to_howto #define elf_backend_plt_not_loaded 1 #define elf_backend_rela_normal 1 #define bfd_elf32_bfd_reloc_type_lookup i370_elf_reloc_type_lookup +#define bfd_elf32_bfd_reloc_name_lookup i370_elf_reloc_name_lookup #define bfd_elf32_bfd_set_private_flags i370_elf_set_private_flags #define bfd_elf32_bfd_merge_private_bfd_data i370_elf_merge_private_bfd_data #define elf_backend_relocate_section i370_elf_relocate_section @@ -1456,7 +1443,7 @@ i370_elf_post_process_headers (bfd * abfd, #define elf_backend_section_from_shdr i370_elf_section_from_shdr #define elf_backend_adjust_dynamic_symbol i370_elf_adjust_dynamic_symbol #define elf_backend_check_relocs i370_elf_check_relocs -#define elf_backend_post_process_headers i370_elf_post_process_headers +#define elf_backend_post_process_headers _bfd_elf_set_osabi static int i370_noop (void)