gnuld might keep dangling/unused symbols around (see sourceware PR13621). Add _edata (end of initialized data address) and _end (end of uninitialized data address) to that list. They might have been added by gnuld even if there is no such [un]initialized data. Also add the double underscore variants which are used on some architectures.
Signed-off-by: Mark Wielaard <m...@redhat.com> --- src/ChangeLog | 5 +++++ src/elflint.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3f970a2..9ed151c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-12-31 Mark Wielaard <m...@redhat.com> + + * elflint.c (check_symtab): Add _edata and _end (plus extra underscore + variants) to to the list of possibly dangling symbols. + 2015-12-16 Mark Wielaard <m...@redhat.com> * elfcompress.c: New file. diff --git a/src/elflint.c b/src/elflint.c index 86cf331..7a7b9ce 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -801,7 +801,11 @@ section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"), && strcmp (name, "__bss_start") != 0 && strcmp (name, "__bss_start__") != 0 && strcmp (name, "__TMC_END__") != 0 - && strcmp (name, ".TOC.") != 0)) + && strcmp (name, ".TOC.") != 0 + && strcmp (name, "_edata") != 0 + && strcmp (name, "__edata") != 0 + && strcmp (name, "_end") != 0 + && strcmp (name, "__end") != 0)) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: st_value out of bounds\n"), idx, section_name (ebl, idx), cnt); -- 2.5.0