GNU Binutils with patches for OS216
Revisão | 6f20ed8a6ba1a01fb356eea8ea45310ed8478a27 (tree) |
---|---|
Hora | 2015-08-31 22:24:06 |
Autor | Alan Modra <amodra@gmai...> |
Commiter | Alan Modra |
ppc64 section group handling
Two organizational changes to the array of additional info kept for
sections.
1) Move group info into a per-group allocated struct, in preparation
for future changes that need per-group accounting.
2) Expand the array to include output sections, which simplifies
sizing and removes the need for a separate output section array.
* section.c (section_id): Make file scope.
(bfd_get_next_section_id): New function.
* elf64-ppc.c (struct map_stub): Remove toc_off field. Move decl.
(struct ppc_stub_hash_entry): Delete stub_sec and id_sec. Add
group. Update all uses.
(struct ppc_link_hash_table): Delete top_id, top_index, and
input_list. Add sec_info_arr_size. Rename stub_group to
sec_info, and make group info indirect. Update stub_group refs
throughout file.
(ppc_add_stub): Don't look for stub_sec on link_sec stub_group
entry.
(ppc_build_one_stub): Delete FIXME.
(ppc64_elf_setup_section_lists): Size htab->sec_info for all
sections, not just input sections. Don't create htab->input_list.
(ppc64_elf_next_input_section): Update to use sec_info union as
list pointer.
(PREV_SEC): Delete.
(group_sections): Pass "info" param rather than "htab". Iterate
over output sections rather than input_list. Use sec_info union
as list pointers. Alloc atruct map_stub, and return fail status.
* bfd-in2.h: Regenerate.
@@ -1,5 +1,29 @@ | ||
1 | 1 | 2015-08-31 Alan Modra <amodra@gmail.com> |
2 | 2 | |
3 | + * section.c (section_id): Make file scope. | |
4 | + (bfd_get_next_section_id): New function. | |
5 | + * elf64-ppc.c (struct map_stub): Remove toc_off field. Move decl. | |
6 | + (struct ppc_stub_hash_entry): Delete stub_sec and id_sec. Add | |
7 | + group. Update all uses. | |
8 | + (struct ppc_link_hash_table): Delete top_id, top_index, and | |
9 | + input_list. Add sec_info_arr_size. Rename stub_group to | |
10 | + sec_info, and make group info indirect. Update stub_group refs | |
11 | + throughout file. | |
12 | + (ppc_add_stub): Don't look for stub_sec on link_sec stub_group | |
13 | + entry. | |
14 | + (ppc_build_one_stub): Delete FIXME. | |
15 | + (ppc64_elf_setup_section_lists): Size htab->sec_info for all | |
16 | + sections, not just input sections. Don't create htab->input_list. | |
17 | + (ppc64_elf_next_input_section): Update to use sec_info union as | |
18 | + list pointer. | |
19 | + (PREV_SEC): Delete. | |
20 | + (group_sections): Pass "info" param rather than "htab". Iterate | |
21 | + over output sections rather than input_list. Use sec_info union | |
22 | + as list pointers. Alloc atruct map_stub, and return fail status. | |
23 | + * bfd-in2.h: Regenerate. | |
24 | + | |
25 | +2015-08-31 Alan Modra <amodra@gmail.com> | |
26 | + | |
3 | 27 | * elflink.c (elf_sort_symbol): Use correctly sized type for |
4 | 28 | calculating signed section->id difference. |
5 | 29 | (elf_link_add_object_symbols): Likewise. |
@@ -1818,6 +1818,8 @@ asection *bfd_make_section_with_flags | ||
1818 | 1818 | |
1819 | 1819 | asection *bfd_make_section (bfd *, const char *name); |
1820 | 1820 | |
1821 | +int bfd_get_next_section_id (void); | |
1822 | + | |
1821 | 1823 | bfd_boolean bfd_set_section_flags |
1822 | 1824 | (bfd *abfd, asection *sec, flagword flags); |
1823 | 1825 |
@@ -3799,6 +3799,15 @@ enum ppc_stub_type { | ||
3799 | 3799 | ppc_stub_global_entry |
3800 | 3800 | }; |
3801 | 3801 | |
3802 | +/* Information on stub grouping. */ | |
3803 | +struct map_stub | |
3804 | +{ | |
3805 | + /* The stub section. */ | |
3806 | + asection *stub_sec; | |
3807 | + /* This is the section to which stubs in the group will be attached. */ | |
3808 | + asection *link_sec; | |
3809 | +}; | |
3810 | + | |
3802 | 3811 | struct ppc_stub_hash_entry { |
3803 | 3812 | |
3804 | 3813 | /* Base hash table entry structure. */ |
@@ -3806,8 +3815,8 @@ struct ppc_stub_hash_entry { | ||
3806 | 3815 | |
3807 | 3816 | enum ppc_stub_type stub_type; |
3808 | 3817 | |
3809 | - /* The stub section. */ | |
3810 | - asection *stub_sec; | |
3818 | + /* Group information. */ | |
3819 | + struct map_stub *group; | |
3811 | 3820 | |
3812 | 3821 | /* Offset within stub_sec of the beginning of this stub. */ |
3813 | 3822 | bfd_vma stub_offset; |
@@ -3821,10 +3830,6 @@ struct ppc_stub_hash_entry { | ||
3821 | 3830 | struct ppc_link_hash_entry *h; |
3822 | 3831 | struct plt_entry *plt_ent; |
3823 | 3832 | |
3824 | - /* Where this stub is being called from, or, in the case of combined | |
3825 | - stub sections, the first input section in the group. */ | |
3826 | - asection *id_sec; | |
3827 | - | |
3828 | 3833 | /* Symbol st_other. */ |
3829 | 3834 | unsigned char other; |
3830 | 3835 | }; |
@@ -3925,34 +3930,34 @@ struct ppc_link_hash_table | ||
3925 | 3930 | /* Various options and other info passed from the linker. */ |
3926 | 3931 | struct ppc64_elf_params *params; |
3927 | 3932 | |
3928 | - /* Array to keep track of which stub sections have been created, and | |
3929 | - information on stub grouping. */ | |
3930 | - struct map_stub { | |
3931 | - /* This is the section to which stubs in the group will be attached. */ | |
3932 | - asection *link_sec; | |
3933 | - /* The stub section. */ | |
3934 | - asection *stub_sec; | |
3935 | - /* Along with elf_gp, specifies the TOC pointer used in this group. */ | |
3933 | + /* The size of sec_info below. */ | |
3934 | + unsigned int sec_info_arr_size; | |
3935 | + | |
3936 | + /* Per-section array of extra section info. Done this way rather | |
3937 | + than as part of ppc64_elf_section_data so we have the info for | |
3938 | + non-ppc64 sections. */ | |
3939 | + struct | |
3940 | + { | |
3941 | + /* Along with elf_gp, specifies the TOC pointer used by this section. */ | |
3936 | 3942 | bfd_vma toc_off; |
3937 | - } *stub_group; | |
3943 | + | |
3944 | + union | |
3945 | + { | |
3946 | + /* The section group that this section belongs to. */ | |
3947 | + struct map_stub *group; | |
3948 | + /* A temp section list pointer. */ | |
3949 | + asection *list; | |
3950 | + } u; | |
3951 | + } *sec_info; | |
3938 | 3952 | |
3939 | 3953 | /* Temp used when calculating TOC pointers. */ |
3940 | 3954 | bfd_vma toc_curr; |
3941 | 3955 | bfd *toc_bfd; |
3942 | 3956 | asection *toc_first_sec; |
3943 | 3957 | |
3944 | - /* Highest input section id. */ | |
3945 | - unsigned int top_id; | |
3946 | - | |
3947 | - /* Highest output section index. */ | |
3948 | - unsigned int top_index; | |
3949 | - | |
3950 | 3958 | /* Used when adding symbols. */ |
3951 | 3959 | struct ppc_link_hash_entry *dot_syms; |
3952 | 3960 | |
3953 | - /* List of input sections for each output section. */ | |
3954 | - asection **input_list; | |
3955 | - | |
3956 | 3961 | /* Shortcuts to get to dynamic linker sections. */ |
3957 | 3962 | asection *dynbss; |
3958 | 3963 | asection *relbss; |
@@ -4056,13 +4061,12 @@ stub_hash_newfunc (struct bfd_hash_entry *entry, | ||
4056 | 4061 | /* Initialize the local fields. */ |
4057 | 4062 | eh = (struct ppc_stub_hash_entry *) entry; |
4058 | 4063 | eh->stub_type = ppc_stub_none; |
4059 | - eh->stub_sec = NULL; | |
4064 | + eh->group = NULL; | |
4060 | 4065 | eh->stub_offset = 0; |
4061 | 4066 | eh->target_value = 0; |
4062 | 4067 | eh->target_section = NULL; |
4063 | 4068 | eh->h = NULL; |
4064 | 4069 | eh->plt_ent = NULL; |
4065 | - eh->id_sec = NULL; | |
4066 | 4070 | eh->other = 0; |
4067 | 4071 | } |
4068 | 4072 |
@@ -4412,18 +4416,18 @@ ppc_get_stub_entry (const asection *input_section, | ||
4412 | 4416 | struct ppc_link_hash_table *htab) |
4413 | 4417 | { |
4414 | 4418 | struct ppc_stub_hash_entry *stub_entry; |
4415 | - const asection *id_sec; | |
4419 | + struct map_stub *group; | |
4416 | 4420 | |
4417 | 4421 | /* If this input section is part of a group of sections sharing one |
4418 | 4422 | stub section, then use the id of the first section in the group. |
4419 | 4423 | Stub names need to include a section id, as there may well be |
4420 | 4424 | more than one stub used to reach say, printf, and we need to |
4421 | 4425 | distinguish between them. */ |
4422 | - id_sec = htab->stub_group[input_section->id].link_sec; | |
4426 | + group = htab->sec_info[input_section->id].u.group; | |
4423 | 4427 | |
4424 | 4428 | if (h != NULL && h->u.stub_cache != NULL |
4425 | 4429 | && h->u.stub_cache->h == h |
4426 | - && h->u.stub_cache->id_sec == id_sec) | |
4430 | + && h->u.stub_cache->group == group) | |
4427 | 4431 | { |
4428 | 4432 | stub_entry = h->u.stub_cache; |
4429 | 4433 | } |
@@ -4431,7 +4435,7 @@ ppc_get_stub_entry (const asection *input_section, | ||
4431 | 4435 | { |
4432 | 4436 | char *stub_name; |
4433 | 4437 | |
4434 | - stub_name = ppc_stub_name (id_sec, sym_sec, h, rel); | |
4438 | + stub_name = ppc_stub_name (group->link_sec, sym_sec, h, rel); | |
4435 | 4439 | if (stub_name == NULL) |
4436 | 4440 | return NULL; |
4437 | 4441 |
@@ -4455,35 +4459,32 @@ ppc_add_stub (const char *stub_name, | ||
4455 | 4459 | struct bfd_link_info *info) |
4456 | 4460 | { |
4457 | 4461 | struct ppc_link_hash_table *htab = ppc_hash_table (info); |
4462 | + struct map_stub *group; | |
4458 | 4463 | asection *link_sec; |
4459 | 4464 | asection *stub_sec; |
4460 | 4465 | struct ppc_stub_hash_entry *stub_entry; |
4461 | 4466 | |
4462 | - link_sec = htab->stub_group[section->id].link_sec; | |
4463 | - stub_sec = htab->stub_group[section->id].stub_sec; | |
4467 | + group = htab->sec_info[section->id].u.group; | |
4468 | + link_sec = group->link_sec; | |
4469 | + stub_sec = group->stub_sec; | |
4464 | 4470 | if (stub_sec == NULL) |
4465 | 4471 | { |
4466 | - stub_sec = htab->stub_group[link_sec->id].stub_sec; | |
4467 | - if (stub_sec == NULL) | |
4468 | - { | |
4469 | - size_t namelen; | |
4470 | - bfd_size_type len; | |
4471 | - char *s_name; | |
4472 | + size_t namelen; | |
4473 | + bfd_size_type len; | |
4474 | + char *s_name; | |
4472 | 4475 | |
4473 | - namelen = strlen (link_sec->name); | |
4474 | - len = namelen + sizeof (STUB_SUFFIX); | |
4475 | - s_name = bfd_alloc (htab->params->stub_bfd, len); | |
4476 | - if (s_name == NULL) | |
4477 | - return NULL; | |
4476 | + namelen = strlen (link_sec->name); | |
4477 | + len = namelen + sizeof (STUB_SUFFIX); | |
4478 | + s_name = bfd_alloc (htab->params->stub_bfd, len); | |
4479 | + if (s_name == NULL) | |
4480 | + return NULL; | |
4478 | 4481 | |
4479 | - memcpy (s_name, link_sec->name, namelen); | |
4480 | - memcpy (s_name + namelen, STUB_SUFFIX, sizeof (STUB_SUFFIX)); | |
4481 | - stub_sec = (*htab->params->add_stub_section) (s_name, link_sec); | |
4482 | - if (stub_sec == NULL) | |
4483 | - return NULL; | |
4484 | - htab->stub_group[link_sec->id].stub_sec = stub_sec; | |
4485 | - } | |
4486 | - htab->stub_group[section->id].stub_sec = stub_sec; | |
4482 | + memcpy (s_name, link_sec->name, namelen); | |
4483 | + memcpy (s_name + namelen, STUB_SUFFIX, sizeof (STUB_SUFFIX)); | |
4484 | + stub_sec = (*htab->params->add_stub_section) (s_name, link_sec); | |
4485 | + if (stub_sec == NULL) | |
4486 | + return NULL; | |
4487 | + group->stub_sec = stub_sec; | |
4487 | 4488 | } |
4488 | 4489 | |
4489 | 4490 | /* Enter this entry into the linker stub hash table. */ |
@@ -4496,9 +4497,8 @@ ppc_add_stub (const char *stub_name, | ||
4496 | 4497 | return NULL; |
4497 | 4498 | } |
4498 | 4499 | |
4499 | - stub_entry->stub_sec = stub_sec; | |
4500 | + stub_entry->group = group; | |
4500 | 4501 | stub_entry->stub_offset = 0; |
4501 | - stub_entry->id_sec = link_sec; | |
4502 | 4502 | return stub_entry; |
4503 | 4503 | } |
4504 | 4504 |
@@ -10257,7 +10257,7 @@ plt_stub_pad (struct ppc_link_hash_table *htab, | ||
10257 | 10257 | { |
10258 | 10258 | int stub_align = 1 << htab->params->plt_stub_align; |
10259 | 10259 | unsigned stub_size = plt_stub_size (htab, stub_entry, plt_off); |
10260 | - bfd_vma stub_off = stub_entry->stub_sec->size; | |
10260 | + bfd_vma stub_off = stub_entry->group->stub_sec->size; | |
10261 | 10261 | |
10262 | 10262 | if (((stub_off + stub_size - 1) & -stub_align) - (stub_off & -stub_align) |
10263 | 10263 | > ((stub_size - 1) & -stub_align)) |
@@ -10300,7 +10300,7 @@ build_plt_stub (struct ppc_link_hash_table *htab, | ||
10300 | 10300 | to = (glinkoff |
10301 | 10301 | + htab->glink->output_offset |
10302 | 10302 | + htab->glink->output_section->vma); |
10303 | - from = (p - stub_entry->stub_sec->contents | |
10303 | + from = (p - stub_entry->group->stub_sec->contents | |
10304 | 10304 | + 4 * (ALWAYS_EMIT_R2SAVE |
10305 | 10305 | || stub_entry->stub_type == ppc_stub_plt_call_r2save) |
10306 | 10306 | + 4 * (PPC_HA (offset) != 0) |
@@ -10308,8 +10308,8 @@ build_plt_stub (struct ppc_link_hash_table *htab, | ||
10308 | 10308 | != PPC_HA (offset)) |
10309 | 10309 | + 4 * (plt_static_chain != 0) |
10310 | 10310 | + 20 |
10311 | - + stub_entry->stub_sec->output_offset | |
10312 | - + stub_entry->stub_sec->output_section->vma); | |
10311 | + + stub_entry->group->stub_sec->output_offset | |
10312 | + + stub_entry->group->stub_sec->output_section->vma); | |
10313 | 10313 | cmp_branch_off = to - from; |
10314 | 10314 | use_fake_dep = cmp_branch_off + (1 << 25) >= (1 << 26); |
10315 | 10315 | } |
@@ -10522,7 +10522,7 @@ get_r2off (struct bfd_link_info *info, | ||
10522 | 10522 | struct ppc_stub_hash_entry *stub_entry) |
10523 | 10523 | { |
10524 | 10524 | struct ppc_link_hash_table *htab = ppc_hash_table (info); |
10525 | - bfd_vma r2off = htab->stub_group[stub_entry->target_section->id].toc_off; | |
10525 | + bfd_vma r2off = htab->sec_info[stub_entry->target_section->id].toc_off; | |
10526 | 10526 | |
10527 | 10527 | if (r2off == 0) |
10528 | 10528 | { |
@@ -10547,7 +10547,7 @@ get_r2off (struct bfd_link_info *info, | ||
10547 | 10547 | r2off = bfd_get_64 (opd->owner, buf); |
10548 | 10548 | r2off -= elf_gp (info->output_bfd); |
10549 | 10549 | } |
10550 | - r2off -= htab->stub_group[stub_entry->id_sec->id].toc_off; | |
10550 | + r2off -= htab->sec_info[stub_entry->group->link_sec->id].toc_off; | |
10551 | 10551 | return r2off; |
10552 | 10552 | } |
10553 | 10553 |
@@ -10574,8 +10574,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10574 | 10574 | return FALSE; |
10575 | 10575 | |
10576 | 10576 | /* Make a note of the offset within the stubs for this entry. */ |
10577 | - stub_entry->stub_offset = stub_entry->stub_sec->size; | |
10578 | - loc = stub_entry->stub_sec->contents + stub_entry->stub_offset; | |
10577 | + stub_entry->stub_offset = stub_entry->group->stub_sec->size; | |
10578 | + loc = stub_entry->group->stub_sec->contents + stub_entry->stub_offset; | |
10579 | 10579 | |
10580 | 10580 | htab->stub_count[stub_entry->stub_type - 1] += 1; |
10581 | 10581 | switch (stub_entry->stub_type) |
@@ -10591,8 +10591,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10591 | 10591 | |
10592 | 10592 | /* And this is where we are coming from. */ |
10593 | 10593 | off -= (stub_entry->stub_offset |
10594 | - + stub_entry->stub_sec->output_offset | |
10595 | - + stub_entry->stub_sec->output_section->vma); | |
10594 | + + stub_entry->group->stub_sec->output_offset | |
10595 | + + stub_entry->group->stub_sec->output_section->vma); | |
10596 | 10596 | |
10597 | 10597 | size = 4; |
10598 | 10598 | if (stub_entry->stub_type == ppc_stub_long_branch_r2off) |
@@ -10631,10 +10631,10 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10631 | 10631 | |
10632 | 10632 | if (info->emitrelocations) |
10633 | 10633 | { |
10634 | - r = get_relocs (stub_entry->stub_sec, 1); | |
10634 | + r = get_relocs (stub_entry->group->stub_sec, 1); | |
10635 | 10635 | if (r == NULL) |
10636 | 10636 | return FALSE; |
10637 | - r->r_offset = loc - stub_entry->stub_sec->contents; | |
10637 | + r->r_offset = loc - stub_entry->group->stub_sec->contents; | |
10638 | 10638 | r->r_info = ELF64_R_INFO (0, R_PPC64_REL24); |
10639 | 10639 | r->r_addend = dest; |
10640 | 10640 | if (stub_entry->h != NULL) |
@@ -10741,7 +10741,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10741 | 10741 | |
10742 | 10742 | off = (dest |
10743 | 10743 | - elf_gp (htab->brlt->output_section->owner) |
10744 | - - htab->stub_group[stub_entry->id_sec->id].toc_off); | |
10744 | + - htab->sec_info[stub_entry->group->link_sec->id].toc_off); | |
10745 | 10745 | |
10746 | 10746 | if (off + 0x80008000 > 0xffffffff || (off & 7) != 0) |
10747 | 10747 | { |
@@ -10755,10 +10755,10 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10755 | 10755 | |
10756 | 10756 | if (info->emitrelocations) |
10757 | 10757 | { |
10758 | - r = get_relocs (stub_entry->stub_sec, 1 + (PPC_HA (off) != 0)); | |
10758 | + r = get_relocs (stub_entry->group->stub_sec, 1 + (PPC_HA (off) != 0)); | |
10759 | 10759 | if (r == NULL) |
10760 | 10760 | return FALSE; |
10761 | - r[0].r_offset = loc - stub_entry->stub_sec->contents; | |
10761 | + r[0].r_offset = loc - stub_entry->group->stub_sec->contents; | |
10762 | 10762 | if (bfd_big_endian (info->output_bfd)) |
10763 | 10763 | r[0].r_offset += 2; |
10764 | 10764 | if (stub_entry->stub_type == ppc_stub_plt_branch_r2off) |
@@ -10847,11 +10847,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10847 | 10847 | struct ppc_link_hash_entry *fh = ppc_follow_link (stub_entry->h->oh); |
10848 | 10848 | |
10849 | 10849 | /* If the old-ABI "dot-symbol" is undefined make it weak so |
10850 | - we don't get a link error from RELOC_FOR_GLOBAL_SYMBOL. | |
10851 | - FIXME: We used to define the symbol on one of the call | |
10852 | - stubs instead, which is why we test symbol section id | |
10853 | - against htab->top_id in various places. Likely all | |
10854 | - these checks could now disappear. */ | |
10850 | + we don't get a link error from RELOC_FOR_GLOBAL_SYMBOL. */ | |
10855 | 10851 | if (fh->elf.root.type == bfd_link_hash_undefined) |
10856 | 10852 | fh->elf.root.type = bfd_link_hash_undefweak; |
10857 | 10853 | /* Stop undo_symbol_twiddle changing it back to undefined. */ |
@@ -10895,7 +10891,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10895 | 10891 | |
10896 | 10892 | off = (dest |
10897 | 10893 | - elf_gp (plt->output_section->owner) |
10898 | - - htab->stub_group[stub_entry->id_sec->id].toc_off); | |
10894 | + - htab->sec_info[stub_entry->group->link_sec->id].toc_off); | |
10899 | 10895 | |
10900 | 10896 | if (off + 0x80008000 > 0xffffffff || (off & 7) != 0) |
10901 | 10897 | { |
@@ -10913,15 +10909,15 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10913 | 10909 | { |
10914 | 10910 | unsigned pad = plt_stub_pad (htab, stub_entry, off); |
10915 | 10911 | |
10916 | - stub_entry->stub_sec->size += pad; | |
10917 | - stub_entry->stub_offset = stub_entry->stub_sec->size; | |
10912 | + stub_entry->group->stub_sec->size += pad; | |
10913 | + stub_entry->stub_offset = stub_entry->group->stub_sec->size; | |
10918 | 10914 | loc += pad; |
10919 | 10915 | } |
10920 | 10916 | |
10921 | 10917 | r = NULL; |
10922 | 10918 | if (info->emitrelocations) |
10923 | 10919 | { |
10924 | - r = get_relocs (stub_entry->stub_sec, | |
10920 | + r = get_relocs (stub_entry->group->stub_sec, | |
10925 | 10921 | ((PPC_HA (off) != 0) |
10926 | 10922 | + (htab->opd_abi |
10927 | 10923 | ? 2 + (htab->params->plt_static_chain |
@@ -10929,7 +10925,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10929 | 10925 | : 1))); |
10930 | 10926 | if (r == NULL) |
10931 | 10927 | return FALSE; |
10932 | - r[0].r_offset = loc - stub_entry->stub_sec->contents; | |
10928 | + r[0].r_offset = loc - stub_entry->group->stub_sec->contents; | |
10933 | 10929 | if (bfd_big_endian (info->output_bfd)) |
10934 | 10930 | r[0].r_offset += 2; |
10935 | 10931 | r[0].r_addend = dest; |
@@ -10949,7 +10945,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10949 | 10945 | return FALSE; |
10950 | 10946 | } |
10951 | 10947 | |
10952 | - stub_entry->stub_sec->size += size; | |
10948 | + stub_entry->group->stub_sec->size += size; | |
10953 | 10949 | |
10954 | 10950 | if (htab->params->emit_stub_syms) |
10955 | 10951 | { |
@@ -10977,7 +10973,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10977 | 10973 | if (h->root.type == bfd_link_hash_new) |
10978 | 10974 | { |
10979 | 10975 | h->root.type = bfd_link_hash_defined; |
10980 | - h->root.u.def.section = stub_entry->stub_sec; | |
10976 | + h->root.u.def.section = stub_entry->group->stub_sec; | |
10981 | 10977 | h->root.u.def.value = stub_entry->stub_offset; |
10982 | 10978 | h->ref_regular = 1; |
10983 | 10979 | h->def_regular = 1; |
@@ -11027,20 +11023,20 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
11027 | 11023 | off += (plt->output_offset |
11028 | 11024 | + plt->output_section->vma |
11029 | 11025 | - elf_gp (plt->output_section->owner) |
11030 | - - htab->stub_group[stub_entry->id_sec->id].toc_off); | |
11026 | + - htab->sec_info[stub_entry->group->link_sec->id].toc_off); | |
11031 | 11027 | |
11032 | 11028 | size = plt_stub_size (htab, stub_entry, off); |
11033 | 11029 | if (htab->params->plt_stub_align) |
11034 | 11030 | size += plt_stub_pad (htab, stub_entry, off); |
11035 | 11031 | if (info->emitrelocations) |
11036 | 11032 | { |
11037 | - stub_entry->stub_sec->reloc_count | |
11033 | + stub_entry->group->stub_sec->reloc_count | |
11038 | 11034 | += ((PPC_HA (off) != 0) |
11039 | 11035 | + (htab->opd_abi |
11040 | 11036 | ? 2 + (htab->params->plt_static_chain |
11041 | 11037 | && PPC_HA (off + 16) == PPC_HA (off)) |
11042 | 11038 | : 1)); |
11043 | - stub_entry->stub_sec->flags |= SEC_RELOC; | |
11039 | + stub_entry->group->stub_sec->flags |= SEC_RELOC; | |
11044 | 11040 | } |
11045 | 11041 | } |
11046 | 11042 | else |
@@ -11053,9 +11049,9 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
11053 | 11049 | off = (stub_entry->target_value |
11054 | 11050 | + stub_entry->target_section->output_offset |
11055 | 11051 | + stub_entry->target_section->output_section->vma); |
11056 | - off -= (stub_entry->stub_sec->size | |
11057 | - + stub_entry->stub_sec->output_offset | |
11058 | - + stub_entry->stub_sec->output_section->vma); | |
11052 | + off -= (stub_entry->group->stub_sec->size | |
11053 | + + stub_entry->group->stub_sec->output_offset | |
11054 | + + stub_entry->group->stub_sec->output_section->vma); | |
11059 | 11055 | |
11060 | 11056 | /* Reset the stub type from the plt variant in case we now |
11061 | 11057 | can reach with a shorter stub. */ |
@@ -11118,12 +11114,13 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
11118 | 11114 | + htab->brlt->output_offset |
11119 | 11115 | + htab->brlt->output_section->vma |
11120 | 11116 | - elf_gp (htab->brlt->output_section->owner) |
11121 | - - htab->stub_group[stub_entry->id_sec->id].toc_off); | |
11117 | + - htab->sec_info[stub_entry->group->link_sec->id].toc_off); | |
11122 | 11118 | |
11123 | 11119 | if (info->emitrelocations) |
11124 | 11120 | { |
11125 | - stub_entry->stub_sec->reloc_count += 1 + (PPC_HA (off) != 0); | |
11126 | - stub_entry->stub_sec->flags |= SEC_RELOC; | |
11121 | + stub_entry->group->stub_sec->reloc_count | |
11122 | + += 1 + (PPC_HA (off) != 0); | |
11123 | + stub_entry->group->stub_sec->flags |= SEC_RELOC; | |
11127 | 11124 | } |
11128 | 11125 | |
11129 | 11126 | if (stub_entry->stub_type != ppc_stub_plt_branch_r2off) |
@@ -11146,12 +11143,12 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
11146 | 11143 | } |
11147 | 11144 | else if (info->emitrelocations) |
11148 | 11145 | { |
11149 | - stub_entry->stub_sec->reloc_count += 1; | |
11150 | - stub_entry->stub_sec->flags |= SEC_RELOC; | |
11146 | + stub_entry->group->stub_sec->reloc_count += 1; | |
11147 | + stub_entry->group->stub_sec->flags |= SEC_RELOC; | |
11151 | 11148 | } |
11152 | 11149 | } |
11153 | 11150 | |
11154 | - stub_entry->stub_sec->size += size; | |
11151 | + stub_entry->group->stub_sec->size += size; | |
11155 | 11152 | return TRUE; |
11156 | 11153 | } |
11157 | 11154 |
@@ -11162,57 +11159,22 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
11162 | 11159 | int |
11163 | 11160 | ppc64_elf_setup_section_lists (struct bfd_link_info *info) |
11164 | 11161 | { |
11165 | - bfd *input_bfd; | |
11166 | - unsigned int top_id, top_index, id; | |
11167 | - asection *section; | |
11168 | - asection **input_list; | |
11162 | + unsigned int id; | |
11169 | 11163 | bfd_size_type amt; |
11170 | 11164 | struct ppc_link_hash_table *htab = ppc_hash_table (info); |
11171 | 11165 | |
11172 | 11166 | if (htab == NULL) |
11173 | 11167 | return -1; |
11174 | 11168 | |
11175 | - /* Find the top input section id. */ | |
11176 | - for (input_bfd = info->input_bfds, top_id = 3; | |
11177 | - input_bfd != NULL; | |
11178 | - input_bfd = input_bfd->link.next) | |
11179 | - { | |
11180 | - for (section = input_bfd->sections; | |
11181 | - section != NULL; | |
11182 | - section = section->next) | |
11183 | - { | |
11184 | - if (top_id < section->id) | |
11185 | - top_id = section->id; | |
11186 | - } | |
11187 | - } | |
11188 | - | |
11189 | - htab->top_id = top_id; | |
11190 | - amt = sizeof (struct map_stub) * (top_id + 1); | |
11191 | - htab->stub_group = bfd_zmalloc (amt); | |
11192 | - if (htab->stub_group == NULL) | |
11169 | + htab->sec_info_arr_size = bfd_get_next_section_id (); | |
11170 | + amt = sizeof (*htab->sec_info) * (htab->sec_info_arr_size); | |
11171 | + htab->sec_info = bfd_zmalloc (amt); | |
11172 | + if (htab->sec_info == NULL) | |
11193 | 11173 | return -1; |
11194 | 11174 | |
11195 | 11175 | /* Set toc_off for com, und, abs and ind sections. */ |
11196 | 11176 | for (id = 0; id < 3; id++) |
11197 | - htab->stub_group[id].toc_off = TOC_BASE_OFF; | |
11198 | - | |
11199 | - /* We can't use output_bfd->section_count here to find the top output | |
11200 | - section index as some sections may have been removed, and | |
11201 | - strip_excluded_output_sections doesn't renumber the indices. */ | |
11202 | - for (section = info->output_bfd->sections, top_index = 0; | |
11203 | - section != NULL; | |
11204 | - section = section->next) | |
11205 | - { | |
11206 | - if (top_index < section->index) | |
11207 | - top_index = section->index; | |
11208 | - } | |
11209 | - | |
11210 | - htab->top_index = top_index; | |
11211 | - amt = sizeof (asection *) * (top_index + 1); | |
11212 | - input_list = bfd_zmalloc (amt); | |
11213 | - htab->input_list = input_list; | |
11214 | - if (input_list == NULL) | |
11215 | - return -1; | |
11177 | + htab->sec_info[id].toc_off = TOC_BASE_OFF; | |
11216 | 11178 | |
11217 | 11179 | return 1; |
11218 | 11180 | } |
@@ -11761,15 +11723,13 @@ ppc64_elf_next_input_section (struct bfd_link_info *info, asection *isec) | ||
11761 | 11723 | return FALSE; |
11762 | 11724 | |
11763 | 11725 | if ((isec->output_section->flags & SEC_CODE) != 0 |
11764 | - && isec->output_section->index <= htab->top_index) | |
11726 | + && isec->output_section->id < htab->sec_info_arr_size) | |
11765 | 11727 | { |
11766 | - asection **list = htab->input_list + isec->output_section->index; | |
11767 | - /* Steal the link_sec pointer for our list. */ | |
11768 | -#define PREV_SEC(sec) (htab->stub_group[(sec)->id].link_sec) | |
11769 | 11728 | /* This happens to make the list in reverse order, |
11770 | 11729 | which is what we want. */ |
11771 | - PREV_SEC (isec) = *list; | |
11772 | - *list = isec; | |
11730 | + htab->sec_info[isec->id].u.list | |
11731 | + = htab->sec_info[isec->output_section->id].u.list; | |
11732 | + htab->sec_info[isec->output_section->id].u.list = isec; | |
11773 | 11733 | } |
11774 | 11734 | |
11775 | 11735 | if (htab->multi_toc_needed) |
@@ -11793,7 +11753,7 @@ ppc64_elf_next_input_section (struct bfd_link_info *info, asection *isec) | ||
11793 | 11753 | htab->toc_curr = elf_gp (isec->owner); |
11794 | 11754 | } |
11795 | 11755 | |
11796 | - htab->stub_group[isec->id].toc_off = htab->toc_curr; | |
11756 | + htab->sec_info[isec->id].toc_off = htab->toc_curr; | |
11797 | 11757 | return TRUE; |
11798 | 11758 | } |
11799 | 11759 |
@@ -11815,8 +11775,8 @@ check_pasted_section (struct bfd_link_info *info, const char *name) | ||
11815 | 11775 | if (i->has_toc_reloc) |
11816 | 11776 | { |
11817 | 11777 | if (toc_off == 0) |
11818 | - toc_off = htab->stub_group[i->id].toc_off; | |
11819 | - else if (toc_off != htab->stub_group[i->id].toc_off) | |
11778 | + toc_off = htab->sec_info[i->id].toc_off; | |
11779 | + else if (toc_off != htab->sec_info[i->id].toc_off) | |
11820 | 11780 | return FALSE; |
11821 | 11781 | } |
11822 | 11782 |
@@ -11824,14 +11784,14 @@ check_pasted_section (struct bfd_link_info *info, const char *name) | ||
11824 | 11784 | for (i = o->map_head.s; i != NULL; i = i->map_head.s) |
11825 | 11785 | if (i->makes_toc_func_call) |
11826 | 11786 | { |
11827 | - toc_off = htab->stub_group[i->id].toc_off; | |
11787 | + toc_off = htab->sec_info[i->id].toc_off; | |
11828 | 11788 | break; |
11829 | 11789 | } |
11830 | 11790 | |
11831 | 11791 | /* Make sure the whole pasted function uses the same toc offset. */ |
11832 | 11792 | if (toc_off != 0) |
11833 | 11793 | for (i = o->map_head.s; i != NULL; i = i->map_head.s) |
11834 | - htab->stub_group[i->id].toc_off = toc_off; | |
11794 | + htab->sec_info[i->id].toc_off = toc_off; | |
11835 | 11795 | } |
11836 | 11796 | return TRUE; |
11837 | 11797 | } |
@@ -11850,15 +11810,20 @@ ppc64_elf_check_init_fini (struct bfd_link_info *info) | ||
11850 | 11810 | _init and _fini functions into multiple parts. Putting a stub in |
11851 | 11811 | the middle of a function is not a good idea. */ |
11852 | 11812 | |
11853 | -static void | |
11854 | -group_sections (struct ppc_link_hash_table *htab, | |
11813 | +static bfd_boolean | |
11814 | +group_sections (struct bfd_link_info *info, | |
11855 | 11815 | bfd_size_type stub_group_size, |
11856 | 11816 | bfd_boolean stubs_always_before_branch) |
11857 | 11817 | { |
11858 | - asection **list; | |
11818 | + struct ppc_link_hash_table *htab; | |
11819 | + asection *osec; | |
11859 | 11820 | bfd_size_type stub14_group_size; |
11860 | 11821 | bfd_boolean suppress_size_errors; |
11861 | 11822 | |
11823 | + htab = ppc_hash_table (info); | |
11824 | + if (htab == NULL) | |
11825 | + return FALSE; | |
11826 | + | |
11862 | 11827 | suppress_size_errors = FALSE; |
11863 | 11828 | stub14_group_size = stub_group_size >> 10; |
11864 | 11829 | if (stub_group_size == 1) |
@@ -11877,10 +11842,14 @@ group_sections (struct ppc_link_hash_table *htab, | ||
11877 | 11842 | suppress_size_errors = TRUE; |
11878 | 11843 | } |
11879 | 11844 | |
11880 | - list = htab->input_list + htab->top_index; | |
11881 | - do | |
11845 | + for (osec = info->output_bfd->sections; osec != NULL; osec = osec->next) | |
11882 | 11846 | { |
11883 | - asection *tail = *list; | |
11847 | + asection *tail; | |
11848 | + | |
11849 | + if (osec->id >= htab->sec_info_arr_size) | |
11850 | + continue; | |
11851 | + | |
11852 | + tail = htab->sec_info[osec->id].u.list; | |
11884 | 11853 | while (tail != NULL) |
11885 | 11854 | { |
11886 | 11855 | asection *curr; |
@@ -11888,6 +11857,7 @@ group_sections (struct ppc_link_hash_table *htab, | ||
11888 | 11857 | bfd_size_type total; |
11889 | 11858 | bfd_boolean big_sec; |
11890 | 11859 | bfd_vma curr_toc; |
11860 | + struct map_stub *group; | |
11891 | 11861 | |
11892 | 11862 | curr = tail; |
11893 | 11863 | total = tail->size; |
@@ -11897,14 +11867,14 @@ group_sections (struct ppc_link_hash_table *htab, | ||
11897 | 11867 | if (big_sec && !suppress_size_errors) |
11898 | 11868 | (*_bfd_error_handler) (_("%B section %A exceeds stub group size"), |
11899 | 11869 | tail->owner, tail); |
11900 | - curr_toc = htab->stub_group[tail->id].toc_off; | |
11870 | + curr_toc = htab->sec_info[tail->id].toc_off; | |
11901 | 11871 | |
11902 | - while ((prev = PREV_SEC (curr)) != NULL | |
11872 | + while ((prev = htab->sec_info[curr->id].u.list) != NULL | |
11903 | 11873 | && ((total += curr->output_offset - prev->output_offset) |
11904 | 11874 | < (ppc64_elf_section_data (prev) != NULL |
11905 | 11875 | && ppc64_elf_section_data (prev)->has_14bit_branch |
11906 | 11876 | ? stub14_group_size : stub_group_size)) |
11907 | - && htab->stub_group[prev->id].toc_off == curr_toc) | |
11877 | + && htab->sec_info[prev->id].toc_off == curr_toc) | |
11908 | 11878 | curr = prev; |
11909 | 11879 | |
11910 | 11880 | /* OK, the size from the start of CURR to the end is less |
@@ -11917,11 +11887,16 @@ group_sections (struct ppc_link_hash_table *htab, | ||
11917 | 11887 | only break if stubs added make the total size more than |
11918 | 11888 | 2^25, ie. for the default stub_group_size, if stubs total |
11919 | 11889 | more than 2097152 bytes, or nearly 75000 plt call stubs. */ |
11890 | + group = bfd_alloc (curr->owner, sizeof (*group)); | |
11891 | + if (group == NULL) | |
11892 | + return FALSE; | |
11893 | + group->link_sec = curr; | |
11894 | + group->stub_sec = NULL; | |
11920 | 11895 | do |
11921 | 11896 | { |
11922 | - prev = PREV_SEC (tail); | |
11897 | + prev = htab->sec_info[tail->id].u.list; | |
11923 | 11898 | /* Set up this stub group. */ |
11924 | - htab->stub_group[tail->id].link_sec = curr; | |
11899 | + htab->sec_info[tail->id].u.group = group; | |
11925 | 11900 | } |
11926 | 11901 | while (tail != curr && (tail = prev) != NULL); |
11927 | 11902 |
@@ -11938,19 +11913,17 @@ group_sections (struct ppc_link_hash_table *htab, | ||
11938 | 11913 | < (ppc64_elf_section_data (prev) != NULL |
11939 | 11914 | && ppc64_elf_section_data (prev)->has_14bit_branch |
11940 | 11915 | ? stub14_group_size : stub_group_size)) |
11941 | - && htab->stub_group[prev->id].toc_off == curr_toc) | |
11916 | + && htab->sec_info[prev->id].toc_off == curr_toc) | |
11942 | 11917 | { |
11943 | 11918 | tail = prev; |
11944 | - prev = PREV_SEC (tail); | |
11945 | - htab->stub_group[tail->id].link_sec = curr; | |
11919 | + prev = htab->sec_info[tail->id].u.list; | |
11920 | + htab->sec_info[tail->id].u.group = group; | |
11946 | 11921 | } |
11947 | 11922 | } |
11948 | 11923 | tail = prev; |
11949 | 11924 | } |
11950 | 11925 | } |
11951 | - while (list-- != htab->input_list); | |
11952 | - free (htab->input_list); | |
11953 | -#undef PREV_SEC | |
11926 | + return TRUE; | |
11954 | 11927 | } |
11955 | 11928 | |
11956 | 11929 | static const unsigned char glink_eh_frame_cie[] = |
@@ -12055,7 +12028,8 @@ ppc64_elf_size_stubs (struct bfd_link_info *info) | ||
12055 | 12028 | else |
12056 | 12029 | stub_group_size = htab->params->group_size; |
12057 | 12030 | |
12058 | - group_sections (htab, stub_group_size, stubs_always_before_branch); | |
12031 | + if (!group_sections (info, stub_group_size, stubs_always_before_branch)) | |
12032 | + return FALSE; | |
12059 | 12033 | |
12060 | 12034 | while (1) |
12061 | 12035 | { |
@@ -12258,8 +12232,8 @@ ppc64_elf_size_stubs (struct bfd_link_info *info) | ||
12258 | 12232 | fact a call needing a TOC adjustment. */ |
12259 | 12233 | if (code_sec != NULL |
12260 | 12234 | && code_sec->output_section != NULL |
12261 | - && (htab->stub_group[code_sec->id].toc_off | |
12262 | - != htab->stub_group[section->id].toc_off) | |
12235 | + && (htab->sec_info[code_sec->id].toc_off | |
12236 | + != htab->sec_info[section->id].toc_off) | |
12263 | 12237 | && (code_sec->has_toc_reloc |
12264 | 12238 | || code_sec->makes_toc_func_call)) |
12265 | 12239 | stub_type = ppc_stub_long_branch_r2off; |
@@ -12299,7 +12273,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info) | ||
12299 | 12273 | stub_type = ppc_stub_plt_call_r2save; |
12300 | 12274 | |
12301 | 12275 | /* Support for grouping stub sections. */ |
12302 | - id_sec = htab->stub_group[section->id].link_sec; | |
12276 | + id_sec = htab->sec_info[section->id].u.group->link_sec; | |
12303 | 12277 | |
12304 | 12278 | /* Get the name of this stub. */ |
12305 | 12279 | stub_name = ppc_stub_name (id_sec, sym_sec, hash, irela); |
@@ -13234,8 +13208,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, | ||
13234 | 13208 | |
13235 | 13209 | if (h != NULL && &h->elf == htab->elf.hgot) |
13236 | 13210 | { |
13237 | - relocation = (TOCstart | |
13238 | - + htab->stub_group[input_section->id].toc_off); | |
13211 | + relocation = TOCstart + htab->sec_info[input_section->id].toc_off; | |
13239 | 13212 | sec = bfd_abs_section_ptr; |
13240 | 13213 | unresolved_reloc = FALSE; |
13241 | 13214 | } |
@@ -13943,8 +13916,8 @@ ppc64_elf_relocate_section (bfd *output_bfd, | ||
13943 | 13916 | /* Munge up the value and addend so that we call the stub |
13944 | 13917 | rather than the procedure directly. */ |
13945 | 13918 | relocation = (stub_entry->stub_offset |
13946 | - + stub_entry->stub_sec->output_offset | |
13947 | - + stub_entry->stub_sec->output_section->vma); | |
13919 | + + stub_entry->group->stub_sec->output_offset | |
13920 | + + stub_entry->group->stub_sec->output_section->vma); | |
13948 | 13921 | addend = 0; |
13949 | 13922 | reloc_dest = DEST_STUB; |
13950 | 13923 |
@@ -14241,7 +14214,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, | ||
14241 | 14214 | abort (); |
14242 | 14215 | |
14243 | 14216 | relocation = got->output_section->vma + got->output_offset + off; |
14244 | - addend = -(TOCstart + htab->stub_group[input_section->id].toc_off); | |
14217 | + addend = -(TOCstart + htab->sec_info[input_section->id].toc_off); | |
14245 | 14218 | } |
14246 | 14219 | break; |
14247 | 14220 |
@@ -14282,11 +14255,11 @@ ppc64_elf_relocate_section (bfd *output_bfd, | ||
14282 | 14255 | /* Relocation value is TOC base. */ |
14283 | 14256 | relocation = TOCstart; |
14284 | 14257 | if (r_symndx == STN_UNDEF) |
14285 | - relocation += htab->stub_group[input_section->id].toc_off; | |
14258 | + relocation += htab->sec_info[input_section->id].toc_off; | |
14286 | 14259 | else if (unresolved_reloc) |
14287 | 14260 | ; |
14288 | - else if (sec != NULL && sec->id <= htab->top_id) | |
14289 | - relocation += htab->stub_group[sec->id].toc_off; | |
14261 | + else if (sec != NULL && sec->id < htab->sec_info_arr_size) | |
14262 | + relocation += htab->sec_info[sec->id].toc_off; | |
14290 | 14263 | else |
14291 | 14264 | unresolved_reloc = TRUE; |
14292 | 14265 | goto dodyn; |
@@ -14301,7 +14274,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, | ||
14301 | 14274 | case R_PPC64_TOC16_DS: |
14302 | 14275 | case R_PPC64_TOC16_LO_DS: |
14303 | 14276 | case R_PPC64_TOC16_HA: |
14304 | - addend -= TOCstart + htab->stub_group[input_section->id].toc_off; | |
14277 | + addend -= TOCstart + htab->sec_info[input_section->id].toc_off; | |
14305 | 14278 | break; |
14306 | 14279 | |
14307 | 14280 | /* Relocate against the beginning of the section. */ |
@@ -821,13 +821,13 @@ _bfd_generic_new_section_hook (bfd *abfd, asection *newsect) | ||
821 | 821 | return TRUE; |
822 | 822 | } |
823 | 823 | |
824 | +static unsigned int section_id = 0x10; /* id 0 to 3 used by STD_SECTION. */ | |
825 | + | |
824 | 826 | /* Initializes a new section. NEWSECT->NAME is already set. */ |
825 | 827 | |
826 | 828 | static asection * |
827 | 829 | bfd_section_init (bfd *abfd, asection *newsect) |
828 | 830 | { |
829 | - static unsigned int section_id = 0x10; /* id 0 to 3 used by STD_SECTION. */ | |
830 | - | |
831 | 831 | newsect->id = section_id; |
832 | 832 | newsect->index = abfd->section_count; |
833 | 833 | newsect->owner = abfd; |
@@ -1275,6 +1275,23 @@ bfd_make_section (bfd *abfd, const char *name) | ||
1275 | 1275 | |
1276 | 1276 | /* |
1277 | 1277 | FUNCTION |
1278 | + bfd_get_next_section_id | |
1279 | + | |
1280 | +SYNOPSIS | |
1281 | + int bfd_get_next_section_id (void); | |
1282 | + | |
1283 | +DESCRIPTION | |
1284 | + Returns the id that the next section created will have. | |
1285 | +*/ | |
1286 | + | |
1287 | +int | |
1288 | +bfd_get_next_section_id (void) | |
1289 | +{ | |
1290 | + return section_id; | |
1291 | +} | |
1292 | + | |
1293 | +/* | |
1294 | +FUNCTION | |
1278 | 1295 | bfd_set_section_flags |
1279 | 1296 | |
1280 | 1297 | SYNOPSIS |