diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2010-09-23 16:16:38 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@codesourcery.com> | 2010-09-23 16:16:38 +0000 |
commit | 19dd00f8914eb45e2b6b6adefe8d4c1dc7d35ee7 (patch) | |
tree | 9ce6a7ff561194664773a5d5c7ceff1c1689f4af /bfd/elf32-tic6x.c | |
parent | 90ec0d684e3555429768fd2a8ce1d396b4bacbb9 (diff) | |
download | gdb-19dd00f8914eb45e2b6b6adefe8d4c1dc7d35ee7.zip gdb-19dd00f8914eb45e2b6b6adefe8d4c1dc7d35ee7.tar.gz gdb-19dd00f8914eb45e2b6b6adefe8d4c1dc7d35ee7.tar.bz2 |
bfd/
* elf32-tic6x.c (elf32_tic6x_fake_sections): New function.
(elf_backend_fake_sections): Define.
ld/testsuite/
* ld-tic6x/pcrel-reloc-local-r-rel-rela.d: New test.
Diffstat (limited to 'bfd/elf32-tic6x.c')
-rw-r--r-- | bfd/elf32-tic6x.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c index 3815ff1..ed3d3d9 100644 --- a/bfd/elf32-tic6x.c +++ b/bfd/elf32-tic6x.c @@ -1348,6 +1348,31 @@ elf32_tic6x_set_use_rela_p (bfd *abfd, bfd_boolean use_rela_p) } static bfd_boolean +elf32_tic6x_fake_sections (bfd *abfd, + Elf_Internal_Shdr *hdr ATTRIBUTE_UNUSED, + asection *sec) +{ + /* The generic elf_fake_sections will set up REL_HDR using the + default kind of relocations. But, we may actually need both + kinds of relocations, so we set up the second header here. */ + if ((sec->flags & SEC_RELOC) != 0) + { + struct bfd_elf_section_data *esd; + bfd_size_type amt = sizeof (Elf_Internal_Shdr); + + esd = elf_section_data (sec); + BFD_ASSERT (esd->rel_hdr2 == NULL); + esd->rel_hdr2 = bfd_zalloc (abfd, amt); + if (!esd->rel_hdr2) + return FALSE; + _bfd_elf_init_reloc_shdr (abfd, esd->rel_hdr2, sec, + !sec->use_rela_p); + } + + return TRUE; +} + +static bfd_boolean elf32_tic6x_mkobject (bfd *abfd) { bfd_boolean ret; @@ -1765,6 +1790,7 @@ elf32_tic6x_merge_private_bfd_data (bfd *ibfd, bfd *obfd) #define elf_backend_default_use_rela_p 1 #define elf_backend_may_use_rel_p 1 #define elf_backend_may_use_rela_p 1 +#define elf_backend_fake_sections elf32_tic6x_fake_sections #define elf_backend_obj_attrs_arg_type elf32_tic6x_obj_attrs_arg_type #define elf_backend_obj_attrs_section "__TI_build_attributes" #define elf_backend_obj_attrs_section_type SHT_C6000_ATTRIBUTES |