aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2011-05-09 13:12:52 +0000
committerPaul Brook <paul@codesourcery.com>2011-05-09 13:12:52 +0000
commit9cf0e28212068b89d962e7c850f33b56a0f50a09 (patch)
tree0251a1337976aae35a749f1a124060384cbd3ed6 /bfd
parentd260f1291231fcee1d97fe2ed2056af307d237f8 (diff)
downloadbinutils-9cf0e28212068b89d962e7c850f33b56a0f50a09.zip
binutils-9cf0e28212068b89d962e7c850f33b56a0f50a09.tar.gz
binutils-9cf0e28212068b89d962e7c850f33b56a0f50a09.tar.bz2
2011-05-09 Paul Brook <paul@codesourcery.com>
bfd/ * elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): New function. (elf_backend_gc_mark_extra_sections): Define.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-tic6x.c48
2 files changed, 53 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b8c2cf4..5702597 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-09 Paul Brook <paul@codesourcery.com>
+
+ * elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): New function.
+ (elf_backend_gc_mark_extra_sections): Define.
+
2011-05-07 Dave Korn <dave.korn.cygwin@gmail.com>
PR ld/12365
diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index 909225a..6b10654 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -1839,6 +1839,53 @@ elf32_tic6x_finish_dynamic_symbol (bfd * output_bfd,
return TRUE;
}
+/* Unwinding tables are not referenced directly. This pass marks them as
+ required if the corresponding code section is marked. */
+
+static bfd_boolean
+elf32_tic6x_gc_mark_extra_sections (struct bfd_link_info *info,
+ elf_gc_mark_hook_fn gc_mark_hook)
+{
+ bfd *sub;
+ Elf_Internal_Shdr **elf_shdrp;
+ bfd_boolean again;
+
+ /* Marking EH data may cause additional code sections to be marked,
+ requiring multiple passes. */
+ again = TRUE;
+ while (again)
+ {
+ again = FALSE;
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+ {
+ asection *o;
+
+ if (! is_tic6x_elf (sub))
+ continue;
+
+ elf_shdrp = elf_elfsections (sub);
+ for (o = sub->sections; o != NULL; o = o->next)
+ {
+ Elf_Internal_Shdr *hdr;
+
+ hdr = &elf_section_data (o)->this_hdr;
+ if (hdr->sh_type == SHT_C6000_UNWIND
+ && hdr->sh_link
+ && hdr->sh_link < elf_numsections (sub)
+ && !o->gc_mark
+ && elf_shdrp[hdr->sh_link]->bfd_section->gc_mark)
+ {
+ again = TRUE;
+ if (!_bfd_elf_gc_mark (info, o, gc_mark_hook))
+ return FALSE;
+ }
+ }
+ }
+ }
+
+ return TRUE;
+}
+
/* Update the got entry reference counts for the section being removed. */
static bfd_boolean
@@ -3933,6 +3980,7 @@ elf32_tic6x_copy_private_data (bfd * ibfd, bfd * obfd)
#define elf_backend_rela_normal 1
#define elf_backend_got_header_size 8
#define elf_backend_gc_sweep_hook elf32_tic6x_gc_sweep_hook
+#define elf_backend_gc_mark_extra_sections elf32_tic6x_gc_mark_extra_sections
#define elf_backend_modify_program_headers \
elf32_tic6x_modify_program_headers
#define elf_backend_create_dynamic_sections \