This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[commit/ob] som.c compilation errors
Mark Kettenis (mark.kettenis@xs4all.nl):
> I compiled on HP-UX 10.20, where these fields are long. The solution is
> to add explicit casts. Will do that later if nobody fixed it by then.
OK, thanks for this information! I have checked in the following, as
obvious:
2005-04-21 Jerome Guitton <guitton@gnat.com>
* som.c (som_bfd_print_private_bfd_data): Add explicit cast to long
for struct som_exec_auxhdr fields.
Index: som.c
===================================================================
RCS file: /cvs/src/src/bfd/som.c,v
retrieving revision 1.53
diff -u -r1.53 som.c
--- som.c 17 Apr 2005 12:45:30 -0000 1.53
+++ som.c 21 Apr 2005 10:45:59 -0000
@@ -5080,16 +5080,20 @@
fprintf (f, "\n");
fprintf (f, " type %#x\n", auxhdr->type);
fprintf (f, " length %#x\n", auxhdr->length);
- fprintf (f, " text size %#lx\n", exec_header->exec_tsize);
- fprintf (f, " text memory offset %#lx\n", exec_header->exec_tmem);
- fprintf (f, " text file offset %#lx\n", exec_header->exec_tfile);
- fprintf (f, " data size %#lx\n", exec_header->exec_dsize);
- fprintf (f, " data memory offset %#lx\n", exec_header->exec_dmem);
- fprintf (f, " data file offset %#lx\n", exec_header->exec_dfile);
- fprintf (f, " bss size %#lx\n", exec_header->exec_bsize);
- fprintf (f, " entry point %#lx\n", exec_header->exec_entry);
- fprintf (f, " loader flags %#lx\n", exec_header->exec_flags);
- fprintf (f, " bss initializer %#lx\n", exec_header->exec_bfill);
+
+ /* Note that, depending on the HP-UX version, the following fields can be
+ either ints, or longs. */
+
+ fprintf (f, " text size %#lx\n", (long) exec_header->exec_tsize);
+ fprintf (f, " text memory offset %#lx\n", (long) exec_header->exec_tmem);
+ fprintf (f, " text file offset %#lx\n", (long) exec_header->exec_tfile);
+ fprintf (f, " data size %#lx\n", (long) exec_header->exec_dsize);
+ fprintf (f, " data memory offset %#lx\n", (long) exec_header->exec_dmem);
+ fprintf (f, " data file offset %#lx\n", (long) exec_header->exec_dfile);
+ fprintf (f, " bss size %#lx\n", (long) exec_header->exec_bsize);
+ fprintf (f, " entry point %#lx\n", (long) exec_header->exec_entry);
+ fprintf (f, " loader flags %#lx\n", (long) exec_header->exec_flags);
+ fprintf (f, " bss initializer %#lx\n", (long) exec_header->exec_bfill);
}
return TRUE;