* [patch] nto target: code cleanup #2
@ 2009-06-11 19:51 Aleksandar Ristovski
2009-06-15 14:17 ` Ulrich Weigand
0 siblings, 1 reply; 3+ messages in thread
From: Aleksandar Ristovski @ 2009-06-11 19:51 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 252 bytes --]
Hello,
Similar to the previous patch, removing unnecessary
indirections.
Thanks,
--
Aleksandar Ristovski
QNX Software Systems
ChangeLog:
* i386-nto-tdep.c (i386nto_init_abi): Remove nto_svr4_so_ops.
Initialize solib ops direcly and set them.
[-- Attachment #2: i386-nto-tdep.c-removento_svr4_so_ops-20090611.diff --]
[-- Type: text/x-patch, Size: 1937 bytes --]
Index: gdb/i386-nto-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-nto-tdep.c,v
retrieving revision 1.34
diff -u -p -r1.34 i386-nto-tdep.c
--- gdb/i386-nto-tdep.c 11 Jun 2009 19:29:00 -0000 1.34
+++ gdb/i386-nto-tdep.c 11 Jun 2009 19:49:53 -0000
@@ -322,7 +322,6 @@ static void
i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- static struct target_so_ops nto_svr4_so_ops;
/* Deal with our strange signals. */
nto_initialize_signals ();
@@ -349,25 +348,16 @@ i386nto_init_abi (struct gdbarch_info in
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
- /* Initialize this lazily, to avoid an initialization order
- dependency on solib-svr4.c's _initialize routine. */
- if (nto_svr4_so_ops.in_dynsym_resolve_code == NULL)
- {
- nto_svr4_so_ops = svr4_so_ops;
-
- /* Our loader handles solib relocations differently than svr4. */
- nto_svr4_so_ops.relocate_section_addresses
- = nto_relocate_section_addresses;
-
- /* Supply a nice function to find our solibs. */
- nto_svr4_so_ops.find_and_open_solib
- = nto_find_and_open_solib;
-
- /* Our linker code is in libc. */
- nto_svr4_so_ops.in_dynsym_resolve_code
- = nto_in_dynsym_resolve_code;
- }
- set_solib_ops (gdbarch, &nto_svr4_so_ops);
+ /* Our loader handles solib relocations differently than svr4. */
+ svr4_so_ops.relocate_section_addresses = nto_relocate_section_addresses;
+
+ /* Supply a nice function to find our solibs. */
+ svr4_so_ops.find_and_open_solib = nto_find_and_open_solib;
+
+ /* Our linker code is in libc. */
+ svr4_so_ops.in_dynsym_resolve_code = nto_in_dynsym_resolve_code;
+
+ set_solib_ops (gdbarch, &svr4_so_ops);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch] nto target: code cleanup #2
2009-06-11 19:51 [patch] nto target: code cleanup #2 Aleksandar Ristovski
@ 2009-06-15 14:17 ` Ulrich Weigand
2009-06-15 14:35 ` Aleksandar Ristovski
0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Weigand @ 2009-06-15 14:17 UTC (permalink / raw)
To: Aleksandar Ristovski; +Cc: gdb-patches
Aleksandar Ristovski wrote:
> * i386-nto-tdep.c (i386nto_init_abi): Remove nto_svr4_so_ops.
> Initialize solib ops direcly and set them.
> + /* Our loader handles solib relocations differently than svr4. */
> + svr4_so_ops.relocate_section_addresses = nto_relocate_section_addresses;
Sorry, this is not correct.
The SVR4 operations must remain unchanged. For example, you might want to
debug both native Linux (using SVR4 solib ops) and remote NTO (using the NTO
solib ops) in a single GDB session -- if the NTO code clobbers the SVR4 ops,
this won't be possible.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] nto target: code cleanup #2
2009-06-15 14:17 ` Ulrich Weigand
@ 2009-06-15 14:35 ` Aleksandar Ristovski
0 siblings, 0 replies; 3+ messages in thread
From: Aleksandar Ristovski @ 2009-06-15 14:35 UTC (permalink / raw)
To: Ulrich Weigand; +Cc: gdb-patches
Ulrich Weigand wrote:
> Aleksandar Ristovski wrote:
>
>> * i386-nto-tdep.c (i386nto_init_abi): Remove nto_svr4_so_ops.
>> Initialize solib ops direcly and set them.
>
>> + /* Our loader handles solib relocations differently than svr4. */
>> + svr4_so_ops.relocate_section_addresses = nto_relocate_section_addresses;
>
> Sorry, this is not correct.
>
> The SVR4 operations must remain unchanged. For example, you might want to
> debug both native Linux (using SVR4 solib ops) and remote NTO (using the NTO
> solib ops) in a single GDB session -- if the NTO code clobbers the SVR4 ops,
> this won't be possible.
>
> Bye,
> Ulrich
>
Ok, thanks.
I guess I really must start working with gdb configured for
linux/nto.
Thanks,
Aleksandar
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-15 14:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-11 19:51 [patch] nto target: code cleanup #2 Aleksandar Ristovski
2009-06-15 14:17 ` Ulrich Weigand
2009-06-15 14:35 ` Aleksandar Ristovski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox