diff options
Diffstat (limited to 'arch/sh/kernel/module.c')
-rw-r--r-- | arch/sh/kernel/module.c | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/arch/sh/kernel/module.c b/arch/sh/kernel/module.c index d297a148d16c..43adddfe4c04 100644 --- a/arch/sh/kernel/module.c +++ b/arch/sh/kernel/module.c | |||
@@ -146,41 +146,16 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
146 | const Elf_Shdr *sechdrs, | 146 | const Elf_Shdr *sechdrs, |
147 | struct module *me) | 147 | struct module *me) |
148 | { | 148 | { |
149 | #ifdef CONFIG_DWARF_UNWINDER | 149 | int ret = 0; |
150 | unsigned int i, err; | ||
151 | unsigned long start, end; | ||
152 | char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; | ||
153 | |||
154 | start = end = 0; | ||
155 | |||
156 | for (i = 1; i < hdr->e_shnum; i++) { | ||
157 | /* Alloc bit cleared means "ignore it." */ | ||
158 | if ((sechdrs[i].sh_flags & SHF_ALLOC) | ||
159 | && !strcmp(secstrings+sechdrs[i].sh_name, ".eh_frame")) { | ||
160 | start = sechdrs[i].sh_addr; | ||
161 | end = start + sechdrs[i].sh_size; | ||
162 | break; | ||
163 | } | ||
164 | } | ||
165 | 150 | ||
166 | /* Did we find the .eh_frame section? */ | 151 | ret |= module_dwarf_finalize(hdr, sechdrs, me); |
167 | if (i != hdr->e_shnum) { | 152 | ret |= module_bug_finalize(hdr, sechdrs, me); |
168 | err = dwarf_parse_section((char *)start, (char *)end, me); | ||
169 | if (err) | ||
170 | printk(KERN_WARNING "%s: failed to parse DWARF info\n", | ||
171 | me->name); | ||
172 | } | ||
173 | |||
174 | #endif /* CONFIG_DWARF_UNWINDER */ | ||
175 | 153 | ||
176 | return module_bug_finalize(hdr, sechdrs, me); | 154 | return ret; |
177 | } | 155 | } |
178 | 156 | ||
179 | void module_arch_cleanup(struct module *mod) | 157 | void module_arch_cleanup(struct module *mod) |
180 | { | 158 | { |
181 | module_bug_cleanup(mod); | 159 | module_bug_cleanup(mod); |
182 | 160 | module_dwarf_cleanup(mod); | |
183 | #ifdef CONFIG_DWARF_UNWINDER | ||
184 | dwarf_module_unload(mod); | ||
185 | #endif /* CONFIG_DWARF_UNWINDER */ | ||
186 | } | 161 | } |