QElfParser: fix type of sh_size
authorPino Toscano <toscano.pino@tiscali.it>
Tue, 15 May 2012 12:40:15 +0000 (14:40 +0200)
committerLisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>
Tue, 5 Feb 2013 21:52:29 +0000 (21:52 +0000)
The type of the sh_size field of a section header is either Elf32_Word or Elf64_Xword,
so the type used cannot be qelfword_t (always 32 bits) but qelfoff_t.

Change-Id: Ia380b6823913fee7a96b39f742630ae3a9ca0cb8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Arvid Picciani <arvid.picciani@nokia.com>
(backport of 77b179689ba37dc909778fdd00df2701f83a2868 from qtbase)

Gbp-Pq: Name QElfParser-fix-type-of-sh_size.patch

src/corelib/plugin/qelfparser_p.cpp
src/corelib/plugin/qelfparser_p.h

index cfe9a9d1b5829ee72ad874135835559822c19d21..33fff42ed962521c62edf4847798910813f4c78f 100644 (file)
@@ -61,8 +61,8 @@ const char *QElfParser::parseSectionHeader(const char *data, ElfSectionHeader *s
          + sizeof(qelfaddr_t);  // sh_addr
     sh->offset = read<qelfoff_t>(data);
     data += sizeof(qelfoff_t);  // sh_offset
-    sh->size = read<qelfword_t>(data);
-    data += sizeof(qelfword_t); // sh_size
+    sh->size = read<qelfoff_t>(data);
+    data += sizeof(qelfoff_t);  // sh_size
     return data;
 }
 
index 2f10807720f7894ba61b003812b4fc9dbb3205fa..e552cbc41d13858469d96c80c451edb7921942a8 100644 (file)
@@ -80,7 +80,7 @@ public:
         qelfword_t name;
         qelfword_t type;
         qelfoff_t  offset;
-        qelfword_t size;
+        qelfoff_t  size;
     };
 
     int m_endian;