1 ===================================================================
2 RCS file: /cvs/src/src/bfd/elf-eh-frame.c,v
3 retrieving revision 1.57
4 retrieving revision 1.58
6 --- src/bfd/elf-eh-frame.c 2007/05/10 15:08:02 1.57
7 +++ src/bfd/elf-eh-frame.c 2007/05/12 14:27:34 1.58
11 unsigned char version;
12 + unsigned char local_personality;
13 char augmentation[20];
15 bfd_signed_vma data_align;
17 bfd_vma augmentation_size;
18 - bfd_vma personality;
20 + struct elf_link_hash_entry *h;
24 struct eh_cie_fde *cie_inf;
25 unsigned char per_encoding;
27 if (c1->hash == c2->hash
28 && c1->length == c2->length
29 && c1->version == c2->version
30 + && c1->local_personality == c2->local_personality
31 && strcmp (c1->augmentation, c2->augmentation) == 0
32 && strcmp (c1->augmentation, "eh") != 0
33 && c1->code_align == c2->code_align
34 && c1->data_align == c2->data_align
35 && c1->ra_column == c2->ra_column
36 && c1->augmentation_size == c2->augmentation_size
37 - && c1->personality == c2->personality
38 + && memcmp (&c1->personality, &c2->personality,
39 + sizeof (c1->personality)) == 0
40 && c1->output_sec == c2->output_sec
41 && c1->per_encoding == c2->per_encoding
42 && c1->lsda_encoding == c2->lsda_encoding
44 REQUIRE (skip_bytes (&buf, end, length));
46 ENSURE_NO_RELOCS (buf);
47 - /* Ensure we have a reloc here, against
49 + /* Ensure we have a reloc here. */
50 if (GET_RELOC (buf) != NULL)
52 unsigned long r_symndx;
53 - asection *sym_sec = NULL;
60 r_symndx = ELF32_R_SYM (cookie->rel->r_info);
61 - if (r_symndx >= cookie->locsymcount)
62 + if (r_symndx >= cookie->locsymcount
63 + || ELF_ST_BIND (cookie->locsyms[r_symndx]
64 + .st_info) != STB_LOCAL)
66 struct elf_link_hash_entry *h;
69 h = (struct elf_link_hash_entry *)
72 - if (h->root.type == bfd_link_hash_defined
73 - || h->root.type == bfd_link_hash_defweak)
75 - cie->personality = h->root.u.def.value;
76 - sym_sec = h->root.u.def.section;
78 + cie->personality.h = h;
82 - Elf_Internal_Shdr *symtab_hdr;
83 Elf_Internal_Sym *sym;
87 - symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
88 - sym = bfd_elf_get_elf_syms (abfd, symtab_hdr,
92 + sym = &cookie->locsyms[r_symndx];
93 + sym_sec = (bfd_section_from_elf_index
94 + (abfd, sym->st_shndx));
95 + if (sym_sec->kept_section != NULL)
96 + sym_sec = sym_sec->kept_section;
98 + && sym_sec->output_section != NULL)
100 - cie->personality = sym->st_value;
101 - sym_sec = (bfd_section_from_elf_index
102 - (abfd, sym->st_shndx));
104 + val = (sym->st_value
105 + + sym_sec->output_offset
106 + + sym_sec->output_section->vma);
107 + cie->personality.val = val;
108 + cie->local_personality = 1;
111 - if (sym_sec != NULL)
112 - cie->personality += (sym_sec->output_section->vma
113 - + sym_sec->output_offset);
115 /* Cope with MIPS-style composite relocations. */
118 while (GET_RELOC (buf) != NULL);
120 REQUIRE (skip_bytes (&buf, end, per_width));
121 - REQUIRE (cie->personality);
122 + REQUIRE (cie->local_personality || cie->personality.h);