diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2001-07-05 07:27:16 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2001-07-05 07:27:16 +0000 |
commit | 24e01a3675391ef294806f620b20969e58ab8cda (patch) | |
tree | 4b46019443e9fe1a997893214fa99d5094272ece /binutils | |
parent | bd780143bd122fb6b95fe95eb3063b3c07542f41 (diff) | |
download | gdb-24e01a3675391ef294806f620b20969e58ab8cda.zip gdb-24e01a3675391ef294806f620b20969e58ab8cda.tar.gz gdb-24e01a3675391ef294806f620b20969e58ab8cda.tar.bz2 |
2001-07-05 H.J. Lu <hjl@gnu.org>
* objcopy.c (filter_symbols): Don't turn undefined symbols
into local.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 5 | ||||
-rw-r--r-- | binutils/objcopy.c | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 3e12632..ffd5f2f 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2001-07-05 H.J. Lu <hjl@gnu.org> + + * objcopy.c (filter_symbols): Don't turn undefined symbols + into local. + 2001-07-03 H.J. Lu <hjl@gnu.org> * doc/Makefile.am (addr2line.1): Use addr2line.pod instead of diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 6195d4a..3c8331a 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -723,6 +723,7 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount) flagword flags = sym->flags; const char *name = bfd_asymbol_name (sym); int keep; + boolean undefined; if (redefine_sym_list) { @@ -755,10 +756,12 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount) } } + undefined = bfd_is_und_section (bfd_get_section (sym)); + if (remove_leading_char && ((flags & BSF_GLOBAL) != 0 || (flags & BSF_WEAK) != 0 - || bfd_is_und_section (bfd_get_section (sym)) + || undefined || bfd_is_com_section (bfd_get_section (sym))) && name[0] == bfd_get_symbol_leading_char (abfd)) name = bfd_asymbol_name (sym) = name + 1; @@ -781,7 +784,7 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount) keep = 1; else if ((flags & BSF_GLOBAL) != 0 /* Global symbol. */ || (flags & BSF_WEAK) != 0 - || bfd_is_und_section (bfd_get_section (sym)) + || undefined || bfd_is_com_section (bfd_get_section (sym))) keep = strip_symbols != STRIP_UNNEEDED; else if ((flags & BSF_DEBUGGING) != 0) /* Debugging symbol. */ @@ -811,7 +814,7 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount) sym->flags &=~ BSF_GLOBAL; sym->flags |= BSF_WEAK; } - if (keep && (flags & (BSF_GLOBAL | BSF_WEAK)) + if (keep && !undefined && (flags & (BSF_GLOBAL | BSF_WEAK)) && (is_specified_symbol (name, localize_specific_list) || (keepglobal_specific_list != NULL && ! is_specified_symbol (name, keepglobal_specific_list)))) |