diff options
author | Alan Modra <amodra@gmail.com> | 2006-06-20 14:34:08 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2006-06-20 14:34:08 +0000 |
commit | e36284abcf727bced126cad8c8a1cc7ba33ad6c2 (patch) | |
tree | d308125ac4028d70454f104f164a817f53ffd42e /bfd/elfxx-ia64.c | |
parent | add68859a914922df926ec91edeb3282dcf86cd4 (diff) | |
download | gdb-e36284abcf727bced126cad8c8a1cc7ba33ad6c2.zip gdb-e36284abcf727bced126cad8c8a1cc7ba33ad6c2.tar.gz gdb-e36284abcf727bced126cad8c8a1cc7ba33ad6c2.tar.bz2 |
* elf-bfd.h (struct elf_backend_data): Add
elf_backend_modify_program_headers.
* elfxx-target.h (elf_backend_modify_program_headers): Define.
(elfNN_bed): Init new field.
* elf.c (elf_modify_segment_map): Remove comment.
(assign_file_positions_for_load_sections): Only call
elf_modify_segment_map for objcopy/strip.
(assign_file_positions_except_relocs): Call
elf_backend_modify_program_headers.
* elf32-frv.c (elf32_frvfdpic_always_size_sections): Don't make
.stack section.
(elf32_frvfdpic_modify_segment_map): Delete.
(elf32_frvfdpic_modify_program_headers): New.
(elf_backend_modify_segment_map): Don't define.
(elf_backend_modify_program_headers): Define.
* elf32-bfin.c (elf32_bfinfdpic_always_size_sections): Don't make
.stack section.
(elf32_bfinfdpic_modify_segment_map): Delete.
(elf32_bfinfdpic_modify_program_headers): New.
(elf_backend_modify_segment_map): Don't define.
(elf_backend_modify_program_headers): Define.
* elfxx-ia64.c (elfNN_ia64_modify_program_headers): New function.
Split out from..
(elfNN_ia64_modify_segment_map): ..here.
(elf_backend_modify_program_headers): Define.
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r-- | bfd/elfxx-ia64.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index c057967..32dea4c 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -1737,17 +1737,30 @@ elfNN_ia64_modify_segment_map (bfd *abfd, } } - /* Turn on PF_IA_64_NORECOV if needed. This involves traversing all of - the input sections for each output section in the segment and testing - for SHF_IA_64_NORECOV on each. */ - for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + return TRUE; +} + +/* Turn on PF_IA_64_NORECOV if needed. This involves traversing all of + the input sections for each output section in the segment and testing + for SHF_IA_64_NORECOV on each. */ + +static bfd_boolean +elfNN_ia64_modify_program_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + struct elf_obj_tdata *tdata = elf_tdata (abfd); + struct elf_segment_map *m; + Elf_Internal_Phdr *p; + + for (p = tdata->phdr, m = tdata->segment_map; m != NULL; m = m->next, p++) if (m->p_type == PT_LOAD) { int i; for (i = m->count - 1; i >= 0; --i) { struct bfd_link_order *order = m->sections[i]->map_head.link_order; - while (order) + + while (order != NULL) { if (order->type == bfd_indirect_link_order) { @@ -1755,7 +1768,7 @@ elfNN_ia64_modify_segment_map (bfd *abfd, bfd_vma flags = elf_section_data(is)->this_hdr.sh_flags; if (flags & SHF_IA_64_NORECOV) { - m->p_flags |= PF_IA_64_NORECOV; + p->p_flags |= PF_IA_64_NORECOV; goto found; } } @@ -5728,6 +5741,8 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, elfNN_ia64_additional_program_headers #define elf_backend_modify_segment_map \ elfNN_ia64_modify_segment_map +#define elf_backend_modify_program_headers \ + elfNN_ia64_modify_program_headers #define elf_info_to_howto \ elfNN_ia64_info_to_howto |