summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-04-19 15:33:29 +0000
committerPedro Alves <palves@redhat.com>2013-04-19 15:33:29 +0000
commitdb5be46fdcf41109a017cbdaeeac5acc9a1f78f3 (patch)
treefdebdb6963ca2806ecb86fe6fdd7be85fb0ce3bd
parent0f928d685b5b8adbf5e557fb21da52e4b8aace8b (diff)
downloadbinutils-gdb-db5be46fdcf41109a017cbdaeeac5acc9a1f78f3.tar.gz
-Wpointer-sign: coff-pe-read.c: treat strings in PE/COFF data as char *.
A couple places take a pointer to the middle of some raw section buffer and treat them as strings. Add casts to char * as appropriate, fixing -Wpointer-sign warnings. gdb/ 2013-04-19 Pedro Alves <palves@redhat.com> * coff-pe-read.c (read_pe_exported_syms): Handle strings as char.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/coff-pe-read.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6e6cf671161..47a8ac2c188 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2013-04-19 Pedro Alves <palves@redhat.com>
+ * coff-pe-read.c (read_pe_exported_syms): Handle strings as char.
+
+2013-04-19 Pedro Alves <palves@redhat.com>
+
* record-full.c (record_full_get_bookmark): Change local 'ret'
type to char * and add cast to gdb_byte *.
(record_full_goto_bookmark): Handle 'bookmark' argument as a
diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c
index 8961c781621..91ee3f60dcb 100644
--- a/gdb/coff-pe-read.c
+++ b/gdb/coff-pe-read.c
@@ -505,7 +505,7 @@ read_pe_exported_syms (struct objfile *objfile)
exp_funcbase = pe_as32 (expdata + 28);
/* Use internal dll name instead of full pathname. */
- dll_name = pe_as32 (expdata + 12) + erva;
+ dll_name = (char *) (pe_as32 (expdata + 12) + erva);
pe_sections_info.nb_sections = otherix;
pe_sections_info.sections = section_data;
@@ -579,9 +579,10 @@ read_pe_exported_syms (struct objfile *objfile)
if ((func_rva >= section_data[sectix].rva_start)
&& (func_rva < section_data[sectix].rva_end))
{
+ char *sym_name = (char *) (erva + name_rva);
+
section_found = 1;
- add_pe_exported_sym (erva + name_rva,
- func_rva, ordinal,
+ add_pe_exported_sym (sym_name, func_rva, ordinal,
section_data + sectix, dll_name, objfile);
++nbnormal;
break;