Re: [PATCH] solib-svr4: Avoid unwanted shlib internal BPs When debugging Linux kernel or u-boot

Mark Kettenis
2012-06-08T13:37:22Z

> Date: Fri, 08 Jun 2012 14:07:14 +0100
> From: Pedro Alves <palves@redhat.com>
>
> On 06/08/2012 01:38 PM, Jan Kratochvil wrote:
> > I still do not see why 'main' was not left there as it would not hurt and it
> > could help.
>
> The original patch was trivial, and a one liner. I preferred not
> requiring bigger changes and risk needing to require copyright
> assignment for that patch. Then, GDB has not been trapping on
> "main", but on "_start" for static binaries for a long time, so that
> even feels like a separate "feature" to me.

The problem here is that "_start" is by no means a standardized name,
whereas "main" is (although there are some exceptions).

> I even feel like we could/should drop the "_start/main" fallback
> from svr4 handling. It's just historic at this point, as far as I
> could ascertain. If those are really needed on some system, then a
> comment in the code mentioning such system is warranted.

Please don't do this. The fallback is useful when bringing up GDB on
a new platform that decided to use yet another name for the ld.so
state point "function". Or in other cases where for some reason
placing breakpoints in ld.so doesn't work but putting them in the
executable itself does work. I've been in that situation at least a
couple of times in the past couple of years.