On 11/29/2010 11:13 AM, Arun Sharma wrote:
> On Wed, Nov 17, 2010 at 9:14 PM, Zachary T Welch
> <[email protected]> wrote:
>> +  ehdr = ei->image;
>> +  if (strncmp(ehdr->e_ident, "\x7f" "ELF", 4) != 0)
>> +    return -1;
> 
> This seems to cause a lot of compiler warnings that look like:
> 
> ./elfxx.h: In function ‘elf_map_image’:
> ./elfxx.h:70: warning: pointer targets in passing argument 1 of
> ‘strlen’ differ in signedness
> /usr/include/string.h:397: note: expected ‘const char *’ but argument
> is of type ‘unsigned char *’

Oops! I somehow sent the wrong version of the patch and didn't notice.
Since I have continued to dig around the code, I revisited this patch
again today and made some additional improvements.

First, I improved _UelfXX_valid_object() to add the ELF header version
check therein; then, I made elf_map_image() call it. As a consequence of
this second change, elf_map_image() needed to be moved out-of-line,
because test-setjmp failed to resolve the newly added call to
valid_object() when linking against libunwind-setjmp.so. However, the
occurrence of a link failure seems to demonstrate that the compiler
previously was ignoring the inline directive, so I expect this change
makes no real difference.

I will send these changes as a new series momentarily.

-- 
Zach Welch
CodeSourcery
[email protected]
(650) 331-3385 x743

_______________________________________________
Libunwind-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to