From: Tom Tromey Date: Wed, 18 May 2022 15:51:10 +0000 (-0600) Subject: ODR warning for "struct find_targ_sec_arg" X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ddfc4ef12441bef95ea0bf0a2fb68fe58e24440a;p=binutils-gdb.git ODR warning for "struct find_targ_sec_arg" "struct find_targ_sec_arg" is defined in multiple .c files, causing ODR warnings. This patch renames the types. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395 --- diff --git a/gdb/coffread.c b/gdb/coffread.c index 75cf646c980..474a1aa02f5 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -254,7 +254,7 @@ coff_locate_sections (bfd *abfd, asection *sectp, void *csip) /* Return the section_offsets* that CS points to. */ static int cs_to_section (struct coff_symbol *, struct objfile *); -struct find_targ_sec_arg +struct coff_find_targ_sec_arg { int targ_index; asection **resultp; @@ -263,7 +263,7 @@ struct find_targ_sec_arg static void find_targ_sec (bfd *abfd, asection *sect, void *obj) { - struct find_targ_sec_arg *args = (struct find_targ_sec_arg *) obj; + struct coff_find_targ_sec_arg *args = (struct coff_find_targ_sec_arg *) obj; if (sect->target_index == args->targ_index) *args->resultp = sect; @@ -274,7 +274,7 @@ static struct bfd_section* cs_to_bfd_section (struct coff_symbol *cs, struct objfile *objfile) { asection *sect = NULL; - struct find_targ_sec_arg args; + struct coff_find_targ_sec_arg args; args.targ_index = cs->c_secnum; args.resultp = § @@ -301,7 +301,7 @@ static CORE_ADDR cs_section_address (struct coff_symbol *cs, bfd *abfd) { asection *sect = NULL; - struct find_targ_sec_arg args; + struct coff_find_targ_sec_arg args; CORE_ADDR addr = 0; args.targ_index = cs->c_secnum; diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 9adc841b1f1..250bd9f4a94 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -249,7 +249,7 @@ static void process_linenos (CORE_ADDR, CORE_ADDR); static int secnum_to_section (int, struct objfile *); static asection *secnum_to_bfd_section (int, struct objfile *); -struct find_targ_sec_arg +struct xcoff_find_targ_sec_arg { int targ_index; int *resultp; @@ -262,7 +262,8 @@ static void find_targ_sec (bfd *, asection *, void *); static void find_targ_sec (bfd *abfd, asection *sect, void *obj) { - struct find_targ_sec_arg *args = (struct find_targ_sec_arg *) obj; + struct xcoff_find_targ_sec_arg *args + = (struct xcoff_find_targ_sec_arg *) obj; struct objfile *objfile = args->objfile; if (sect->target_index == args->targ_index) @@ -290,7 +291,7 @@ static void xcoff_secnum_to_sections (int n_scnum, struct objfile *objfile, asection **bfd_sect, int *secnum) { - struct find_targ_sec_arg args; + struct xcoff_find_targ_sec_arg args; args.targ_index = n_scnum; args.resultp = secnum;