X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fsolib-svr4.c;h=3f98a1eb4338b2faefee568d5d89550b22c885a5;hb=0d62e5e8077eecf77e9b7b5dc0d2689d051a3ab3;hp=1a7ffbf487077938219e09f7ca92177783125139;hpb=ad3dcc5cf209922b20c8c17bbd0561289430ba4e;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 1a7ffbf487..3f98a1eb43 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -1293,7 +1293,7 @@ static struct link_map_offsets * svr4_fetch_link_map_offsets (void) { struct link_map_offsets *(*flmo)(void) = - gdbarch_data (fetch_link_map_offsets_gdbarch_data); + gdbarch_data (current_gdbarch, fetch_link_map_offsets_gdbarch_data); if (flmo == NULL) { @@ -1318,24 +1318,20 @@ set_solib_svr4_fetch_link_map_offsets (struct gdbarch *gdbarch, set_gdbarch_data (gdbarch, fetch_link_map_offsets_gdbarch_data, flmo); } -/* Initialize the architecture specific link_map_offsets fetcher. - This is called after _gdbarch_init() has set up its struct - gdbarch for the new architecture, so care must be taken to use the - value set by set_solib_svr4_fetch_link_map_offsets(), above. We - do, however, attempt to provide a reasonable alternative (for - native targets anyway) if the _gdbarch_init() fails to call +/* Initialize the architecture-specific link_map_offsets fetcher. + This is called after _gdbarch_init() has set up its `struct + gdbarch' for the new architecture, and is only called if the + link_map_offsets fetcher isn't already initialized (which is + usually done by calling set_solib_svr4_fetch_link_map_offsets() + above in _gdbarch_init()). Therefore we attempt to provide a + reasonable alternative (for native targets anyway) if the + _gdbarch_init() fails to call set_solib_svr4_fetch_link_map_offsets(). */ static void * init_fetch_link_map_offsets (struct gdbarch *gdbarch) { - struct link_map_offsets *(*flmo) = - gdbarch_data (fetch_link_map_offsets_gdbarch_data); - - if (flmo == NULL) - return legacy_fetch_link_map_offsets; - else - return flmo; + return legacy_fetch_link_map_offsets; } static struct target_so_ops svr4_so_ops;