summaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-08-27 11:01:55 +0000
committerNick Clifton <nickc@redhat.com>2002-08-27 11:01:55 +0000
commit0e67980c95d277b18016cdec4240a0e0a0a9ef09 (patch)
tree83f26efc34c84421e5833a4a58615c7a3b14f292 /bfd/elf32-arm.h
parent339c6a3633db11751d936ed024de0990a8e05227 (diff)
downloadgdb-0e67980c95d277b18016cdec4240a0e0a0a9ef09.tar.gz
Revert ARM linker patch and apply similar patch to bfd instead
Diffstat (limited to 'bfd/elf32-arm.h')
-rw-r--r--bfd/elf32-arm.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index bfc1aa66a6a..5cd94347c31 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -3546,6 +3546,31 @@ elf32_arm_finish_dynamic_sections (output_bfd, info)
}
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
+
+ /* Set the bottom bit of DT_INIT/FINI if the
+ corresponding function is Thumb. */
+ case DT_INIT:
+ name = info->init_function;
+ goto get_sym;
+ case DT_FINI:
+ name = info->fini_function;
+ get_sym:
+ /* If it wasn't set by elf_bfd_final_link
+ then there is nothing to ajdust. */
+ if (dyn.d_un.d_val != 0)
+ {
+ struct elf_link_hash_entry * eh;
+
+ eh = elf_link_hash_lookup (elf_hash_table (info), name,
+ false, false, true);
+ if (eh != (struct elf_link_hash_entry *) NULL
+ && ELF_ST_TYPE (eh->type) == STT_ARM_TFUNC)
+ {
+ dyn.d_un.d_val |= 1;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ }
+ }
+ break;
}
}