* Add PIC support for CR16 target.

* elf32-cr16.c (R_CR16_GOT_REGREL20, R_CR16_GOTC_REGREL20 and
        R_CR16_GLOB_DAT): New macros
        (cr16_elf_howto_table): Add entries for for R_CR16_GOT_REGREL20,
        R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT.
        (cr16_reloc_map): Ditto
        (_bfd_cr16_elf_create_got_section): New function to create GOT section.
        (_bfd_cr16_elf_create_dynamic_sections): New function to create dynamic
        section.
        (_bfd_cr16_elf_adjust_dynamic_symbol): New function to adjust symbol
        defined by dynamic object.
        (_bfd_cr16_elf_size_dynamic_sections): New function to find the size
        of dynamic section.
        (_bfd_cr16_elf_finish_dynamic_symbol): New function to handle dynamic
        symbols.
        (_bfd_cr16_elf_finish_dynamic_symbol): New function to handle dynamic
        sections.
        (bfd_cr16_elf32_create_embedded_relocs): New function to create
        embedded relocs in .emreloc section in memory for .data.rel section.
        (_bfd_cr16_elf_reloc_type_class): New function for classify reloc types.
        (cr16_elf_check_relocs): New function for checking reloc types in
        first phase.
        (cr16_elf_final_link_relocate): Update for handling the new reloc
        types R_CR16_GOT_REGREL20 and R_CR16_GOTC_REGREL20.
        (elf32_cr16_relax_section): Update relax implementation.
        * reloc.c (bfd_reloc_code_type): Add entries for R_CR16_GOT_REGREL20,
        R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT.
        * bfd-in.h (bfd_boolean bfd_cr16_elf32_create_embedded_relocs): Declared
        * libbfd.h, bfd-in2.h: Regenerate.
This commit is contained in:
M R Swami Reddy 2008-11-27 12:26:49 +00:00
parent 95beeee886
commit 99706f3093
6 changed files with 1666 additions and 113 deletions

View File

@ -1,3 +1,35 @@
2008-11-27 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
* Add PIC support for CR16 target.
* elf32-cr16.c (R_CR16_GOT_REGREL20, R_CR16_GOTC_REGREL20 and
R_CR16_GLOB_DAT): New macros
(cr16_elf_howto_table): Add entries for for R_CR16_GOT_REGREL20,
R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT.
(cr16_reloc_map): Ditto
(_bfd_cr16_elf_create_got_section): New function to create GOT section.
(_bfd_cr16_elf_create_dynamic_sections): New function to create dynamic
section.
(_bfd_cr16_elf_adjust_dynamic_symbol): New function to adjust symbol
defined by dynamic object.
(_bfd_cr16_elf_size_dynamic_sections): New function to find the size of
dynamic sections.
(_bfd_cr16_elf_finish_dynamic_symbol): New function to handle dynamic
symbols.
(_bfd_cr16_elf_finish_dynamic_symbol): New function to handle dynamic
sections.
(bfd_cr16_elf32_create_embedded_relocs): New function to create
embedded relocs in .emreloc section in memory for .data.rel section.
(_bfd_cr16_elf_reloc_type_class): New function for classify reloc types.
(cr16_elf_check_relocs): New function for checking reloc types in first
phase.
(cr16_elf_final_link_relocate): Update for handling the new reloc types
R_CR16_GOT_REGREL20 and R_CR16_GOTC_REGREL20.
(elf32_cr16_relax_section): Update relax implementation.
* reloc.c (bfd_reloc_code_type): Add entries for R_CR16_GOT_REGREL20,
R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT.
* bfd-in.h (bfd_boolean bfd_cr16_elf32_create_embedded_relocs): Declared
* libbfd.h, bfd-in2.h: Regenerate.
2008-11-26 Alan Modra <amodra@bigpond.net.au>
PR 7047

View File

@ -713,6 +713,10 @@ extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
(bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
char **);
extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
(bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
char **);
/* SunOS shared library support routines for the linker. */
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list

View File

@ -720,6 +720,10 @@ extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
(bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
char **);
extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs
(bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
char **);
/* SunOS shared library support routines for the linker. */
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
@ -4129,6 +4133,9 @@ This is the 5 bits of a value. */
BFD_RELOC_CR16_SWITCH8,
BFD_RELOC_CR16_SWITCH16,
BFD_RELOC_CR16_SWITCH32,
BFD_RELOC_CR16_GOT_REGREL20,
BFD_RELOC_CR16_GOTC_REGREL20,
BFD_RELOC_CR16_GLOB_DAT,
/* NS CRX Relocations. */
BFD_RELOC_CRX_REL4,

File diff suppressed because it is too large Load Diff

View File

@ -1849,6 +1849,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_CR16_SWITCH8",
"BFD_RELOC_CR16_SWITCH16",
"BFD_RELOC_CR16_SWITCH32",
"BFD_RELOC_CR16_GOT_REGREL20",
"BFD_RELOC_CR16_GOTC_REGREL20",
"BFD_RELOC_CR16_GLOB_DAT",
"BFD_RELOC_CRX_REL4",
"BFD_RELOC_CRX_REL8",
"BFD_RELOC_CRX_REL8_CMP",

View File

@ -4610,6 +4610,12 @@ ENUMX
BFD_RELOC_CR16_SWITCH16
ENUMX
BFD_RELOC_CR16_SWITCH32
ENUMX
BFD_RELOC_CR16_GOT_REGREL20
ENUMX
BFD_RELOC_CR16_GOTC_REGREL20
ENUMX
BFD_RELOC_CR16_GLOB_DAT
ENUMDOC
NS CR16 Relocations.