readelf.c won't compile with HP-UX 11.00's cc
Nick Clifton
nickc@redhat.com
Wed Feb 28 11:39:00 GMT 2001
Hi Alan,
> On 27 Feb 2001, Nick Clifton wrote:
>
> > I would still like to eliminate the compile time warning message which
> > the cast was trying to remove. How about this version instead ?
>
> Isn't the real problem that we are lying about struct unw_aux_info.strtab?
> Why not just get rid of the `const'? (and apply Alexandre's patch too)
Seems good to me. I have applied this patch:
Cheers
Nick
2001-02-28 Nick Clifton <nickc@redhat.com>
* readelf.c: (struct unw_aux_info): Remove const modifier for
'strtab' field.
(process_unwind): Remove non-K&R compliant LHS type cast in call
to GET_DATA_ALLOC macro.
Index: readelf.c
===================================================================
RCS file: /cvs/src//src/binutils/readelf.c,v
retrieving revision 1.92
diff -p -r1.92 readelf.c
*** readelf.c 2001/02/28 10:15:57 1.92
--- readelf.c 2001/02/28 19:35:58
*************** struct unw_aux_info
*** 3138,3144 ****
bfd_vma seg_base; /* Starting address of segment. */
Elf_Internal_Sym * symtab; /* The symbol table. */
unsigned long nsyms; /* Number of symbols. */
! const char * strtab; /* The string table. */
unsigned long strtab_size; /* Size of string table. */
};
--- 3138,3144 ----
bfd_vma seg_base; /* Starting address of segment. */
Elf_Internal_Sym * symtab; /* The symbol table. */
unsigned long nsyms; /* Number of symbols. */
! char * strtab; /* The string table. */
unsigned long strtab_size; /* Size of string table. */
};
*************** process_unwind (file)
*** 3425,3431 ****
strsec = section_headers + sec->sh_link;
aux.strtab_size = strsec->sh_size;
GET_DATA_ALLOC (strsec->sh_offset, aux.strtab_size,
! (char *) aux.strtab, char *, "string table");
}
else if (sec->sh_type == SHT_IA_64_UNWIND)
unwsec = sec;
--- 3425,3431 ----
strsec = section_headers + sec->sh_link;
aux.strtab_size = strsec->sh_size;
GET_DATA_ALLOC (strsec->sh_offset, aux.strtab_size,
! aux.strtab, const char *, "string table");
}
else if (sec->sh_type == SHT_IA_64_UNWIND)
unwsec = sec;
More information about the Binutils
mailing list