* sunos.c (sunos_add_one_symbol): Don't core dump if a multiple

definition of an absolute symbol is encountered.
This commit is contained in:
Ian Lance Taylor 1995-01-11 19:42:28 +00:00
parent 040c913e18
commit 788d94361f
2 changed files with 10 additions and 7 deletions

View File

@ -1,5 +1,8 @@
Wed Jan 11 14:36:41 1995 Ian Lance Taylor <ian@sanguine.cygnus.com> Wed Jan 11 14:36:41 1995 Ian Lance Taylor <ian@sanguine.cygnus.com>
* sunos.c (sunos_add_one_symbol): Don't core dump if a multiple
definition of an absolute symbol is encountered.
* linker.c (_bfd_generic_link_add_one_symbol): Ignore * linker.c (_bfd_generic_link_add_one_symbol): Ignore
redefinitions of an absolute symbol to the same value. redefinitions of an absolute symbol to the same value.

View File

@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define ARCH 32
#define TARGETNAME "a.out-sunos-big" #define TARGETNAME "a.out-sunos-big"
#define MY(OP) CAT(sunos_big_,OP) #define MY(OP) CAT(sunos_big_,OP)
@ -855,10 +854,10 @@ sunos_add_one_symbol (info, abfd, name, flags, section, value, string,
section of the dynamic object. We don't want to allocate space section of the dynamic object. We don't want to allocate space
for it in our process image. */ for it in our process image. */
if ((abfd->flags & DYNAMIC) != 0 if ((abfd->flags & DYNAMIC) != 0
&& section == &bfd_com_section) && bfd_is_com_section (section))
section = obj_bsssec (abfd); section = obj_bsssec (abfd);
if (section != &bfd_und_section if (! bfd_is_und_section (section)
&& h->root.root.type != bfd_link_hash_new && h->root.root.type != bfd_link_hash_new
&& h->root.root.type != bfd_link_hash_undefined) && h->root.root.type != bfd_link_hash_undefined)
{ {
@ -870,9 +869,10 @@ sunos_add_one_symbol (info, abfd, name, flags, section, value, string,
We do not want this new definition to override the We do not want this new definition to override the
existing definition, so we pretend it is just a existing definition, so we pretend it is just a
reference. */ reference. */
section = &bfd_und_section; section = bfd_und_section_ptr;
} }
else if ((h->root.root.type == bfd_link_hash_defined else if ((h->root.root.type == bfd_link_hash_defined
&& h->root.root.u.def.section->owner != NULL
&& (h->root.root.u.def.section->owner->flags & DYNAMIC) != 0) && (h->root.root.u.def.section->owner->flags & DYNAMIC) != 0)
|| (h->root.root.type == bfd_link_hash_common || (h->root.root.type == bfd_link_hash_common
&& ((h->root.root.u.c.section->owner->flags & DYNAMIC) && ((h->root.root.u.c.section->owner->flags & DYNAMIC)
@ -898,14 +898,14 @@ sunos_add_one_symbol (info, abfd, name, flags, section, value, string,
object. */ object. */
if ((abfd->flags & DYNAMIC) == 0) if ((abfd->flags & DYNAMIC) == 0)
{ {
if (section == &bfd_und_section) if (bfd_is_und_section (section))
new_flag = SUNOS_REF_REGULAR; new_flag = SUNOS_REF_REGULAR;
else else
new_flag = SUNOS_DEF_REGULAR; new_flag = SUNOS_DEF_REGULAR;
} }
else else
{ {
if (section == &bfd_und_section) if (bfd_is_und_section (section))
new_flag = SUNOS_REF_DYNAMIC; new_flag = SUNOS_REF_DYNAMIC;
else else
new_flag = SUNOS_DEF_DYNAMIC; new_flag = SUNOS_DEF_DYNAMIC;
@ -1668,7 +1668,7 @@ sunos_write_dynamic_symbol (output_bfd, info, harg)
sec = h->root.root.u.def.section; sec = h->root.root.u.def.section;
output_section = sec->output_section; output_section = sec->output_section;
BFD_ASSERT (output_section == &bfd_abs_section BFD_ASSERT (bfd_is_abs_section (output_section)
|| output_section->owner == output_bfd); || output_section->owner == output_bfd);
if (strcmp (sec->name, ".plt") == 0) if (strcmp (sec->name, ".plt") == 0)
{ {