From: Petr Machata Date: Tue, 21 Sep 2010 19:51:22 +0000 (+0200) Subject: dwarflint: check_range_relocations should rather be in check_debug_loc_range X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2e11bbdb125ceda5dc23d84015dd95b2a9076c6;p=thirdparty%2Felfutils.git dwarflint: check_range_relocations should rather be in check_debug_loc_range --- diff --git a/dwarflint/check_debug_loc_range.cc b/dwarflint/check_debug_loc_range.cc index a71ef2784..c348fd3c3 100644 --- a/dwarflint/check_debug_loc_range.cc +++ b/dwarflint/check_debug_loc_range.cc @@ -1076,3 +1076,21 @@ found_hole (uint64_t start, uint64_t length, void *data) return true; } + +void +check_range_relocations (enum message_category cat, + struct where *where, + struct elf_file const *file, + GElf_Sym *begin_symbol, + GElf_Sym *end_symbol, + const char *description) +{ + if (begin_symbol != NULL + && end_symbol != NULL + && begin_symbol->st_shndx != end_symbol->st_shndx) + wr_message (cat | mc_impact_2 | mc_reloc, where, + ": %s relocated against different sections (%s and %s).\n", + description, + file->sec[begin_symbol->st_shndx].name, + file->sec[end_symbol->st_shndx].name); +} diff --git a/dwarflint/check_debug_loc_range.hh b/dwarflint/check_debug_loc_range.hh index 2f8138f97..182f6d3fe 100644 --- a/dwarflint/check_debug_loc_range.hh +++ b/dwarflint/check_debug_loc_range.hh @@ -1,5 +1,5 @@ /* Low-level checking of .debug_loc and .debug_range. - Copyright (C) 2009 Red Hat, Inc. + Copyright (C) 2009, 2010 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -66,12 +66,19 @@ struct hole_info /* DATA has to be a pointer to an instance of struct hole_info. DATA->data has to point at d_buf of section in question. */ -extern bool found_hole (uint64_t start, uint64_t length, void *data); +bool found_hole (uint64_t start, uint64_t length, void *data); -extern bool check_location_expression (elf_file const &file, - struct read_ctx *parent_ctx, - struct cu *cu, - uint64_t init_off, - struct relocation_data *reloc, - size_t length, - struct where *wh); +bool check_location_expression (elf_file const &file, + struct read_ctx *parent_ctx, + struct cu *cu, + uint64_t init_off, + struct relocation_data *reloc, + size_t length, + struct where *wh); + +void check_range_relocations (enum message_category cat, + struct where *where, + struct elf_file const *file, + GElf_Sym *begin_symbol, + GElf_Sym *end_symbol, + const char *description); diff --git a/dwarflint/reloc.cc b/dwarflint/reloc.cc index f271185a3..df7164ead 100644 --- a/dwarflint/reloc.cc +++ b/dwarflint/reloc.cc @@ -434,21 +434,3 @@ read_rel (struct elf_file *file, sizeof (*sec->rel.rel), &compare_rel); return true; } - -void -check_range_relocations (enum message_category cat, - struct where *where, - struct elf_file const *file, - GElf_Sym *begin_symbol, - GElf_Sym *end_symbol, - const char *description) -{ - if (begin_symbol != NULL - && end_symbol != NULL - && begin_symbol->st_shndx != end_symbol->st_shndx) - wr_message (cat | mc_impact_2 | mc_reloc, where, - ": %s relocated against different sections (%s and %s).\n", - description, - file->sec[begin_symbol->st_shndx].name, - file->sec[end_symbol->st_shndx].name); -} diff --git a/dwarflint/reloc.h b/dwarflint/reloc.h index 9f4442f18..5d65f3852 100644 --- a/dwarflint/reloc.h +++ b/dwarflint/reloc.h @@ -31,9 +31,6 @@ #include #include -// xxx remove -#include "messages.h" - #ifdef __cplusplus extern "C" { @@ -96,13 +93,6 @@ extern "C" struct where const *where, enum section_id offset_into, GElf_Sym **symptr); - void check_range_relocations (enum message_category cat, - struct where *where, - struct elf_file const *file, - GElf_Sym *begin_symbol, - GElf_Sym *end_symbol, - const char *description); - #define PRI_LACK_RELOCATION ": %s seems to lack a relocation.\n" #ifdef __cplusplus