[haiku-bugs] Re: [Haiku] #8064: dladdr doesn't work for local symbols

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Wed, 04 Apr 2012 17:57:03 -0000

#8064: dladdr doesn't work for local symbols
---------------------------+-----------------------------------------------
   Reporter:  unitedroad   |      Owner:  axeld
       Type:  bug          |     Status:  new
   Priority:  normal       |  Milestone:  R1
  Component:               |    Version:  R1/alpha3
  System/libroot.so        |   Keywords:  dladdr, shared library, so, dlfcn
 Resolution:               |   Blocking:
 Blocked By:               |   Platform:  All
Has a Patch:  1            |
---------------------------+-----------------------------------------------

Comment (by bonefish):

 Thanks for the patch. It looks basically OK, but I have two remarks:
  - Please don't use uncommon abbreviations in identifier names. `foundSym`
 -> `foundSymbol`, `_symName` -> `_symbolName`.
  - Please don't use goto.
 Either may be violated already in the runtime loader code, but that's
 because we inherited it from NewOS.

 Directly using the name pointers from the runtime loader is not so nice
 (since they can go away any time after unlocking the runtime loader main
 lock), but since the only alternative is what the previous implementation
 of `dladdr()` did -- using static buffers that get overwritten with the
 next call -- it's either a rock or a hard place. I also prefer your
 implementation in this case.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/8064#comment:10>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: