solib-sunos.c is broken

Tom Tromey tromey@redhat.com
Tue Aug 20 19:39:00 GMT 2013


While working on a global change to minimal symbols, I stumbled across
solib-sunos.c.  It is broken.  I think it won't even compile right now.

Anyway, I thought I'd send a note detailing its various problems.  If
someone wants to fix them up, that would be great.  I don't have access
to any of the affected systems.

It's been broken since at least August of last year.  So, it is
apparently not heavily used, at least not by folks involved with this
community (it is referenced by the various a.out *BSD ports, so perhaps
it is patched up in some BSD tree, I don't know).


Here's the bugs I can see from looking:

* This code is set up to only be compiled for a.out hosts.  That is, it
  is treated as though it is part of the "native" target.

  I think conceptually though this code is really not host-dependent,
  but instead should be part of the tdep layer.

  Fixing this would at least enable folks like me to avoid breaking the
  build...  similar to the machoread and somread changes earlier this
  year.

* allocate_rt_common_objfile allocates an objfile "by hand" and
  populates it.  This violate module boundaries; and in this case the
  code has long since bit-rotted.  It doesn't initialize all the fields
  properly -- e.g., the per-bfd object is missing, "name" is allocated
  with xstrdup.  Some fields it does initialize have been moved to the
  per-bfd object (which is why it won't compile...).

  The fix is to change this code to use the exported objfile API.

* solib_add_common_symbols leaves the minimal-symbol-discarding cleanup
  dangling.  Probably not a severe issue, but best avoided.

* rt_common_objfile is a global, but in the new style it should be
  per-progspace.


I'm happy to file a bug with this info, but my sense is that nobody
looks at a.out bug reports.

Tom



More information about the Gdb mailing list