diff options
author | Kai Tietz <kai.tietz@onevision.com> | 2008-05-09 11:56:31 +0000 |
---|---|---|
committer | Kai Tietz <kai.tietz@onevision.com> | 2008-05-09 11:56:31 +0000 |
commit | 0ead4f8d3f902fa7b56cb52642486d799e5fba56 (patch) | |
tree | b4547977627f797b8a15803f4af23f8c7b1a3ab4 /ld | |
parent | 11c68c47488fc7ede21338f47601080ec3ea50c9 (diff) | |
download | gdb-0ead4f8d3f902fa7b56cb52642486d799e5fba56.zip gdb-0ead4f8d3f902fa7b56cb52642486d799e5fba56.tar.gz gdb-0ead4f8d3f902fa7b56cb52642486d799e5fba56.tar.bz2 |
2008-05-09 Kai Tietz <kai.tietz@onevision.com>
ld/PR6502
* emultempl/pep.em (compute_dll_image_base): Use bfd_vma instead of long
and change return type to bfd_vma.
(definfo): Change type of address from long to bfd_vma.
(set_pep_value): Replace strtoul to strtoull.
(gld_${EMULATION_NAME}_set_symbols): use bfd_vma instead of long..
* pe-dll.c (pe_dll_generate_def_file): Use fprintf_vma to print ImageBase.
(quick_reloc): Change argument address from int to bfd_size_type.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 11 | ||||
-rw-r--r-- | ld/emultempl/pep.em | 18 | ||||
-rw-r--r-- | ld/pe-dll.c | 9 |
3 files changed, 25 insertions, 13 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index b0ab26e..fc1fec2 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,14 @@ +2008-05-09 Kai Tietz <kai.tietz@onevision.com> + + ld/PR6502 + * emultempl/pep.em (compute_dll_image_base): Use bfd_vma instead of long + and change return type to bfd_vma. + (definfo): Change type of address from long to bfd_vma. + (set_pep_value): Replace strtoul to strtoull. + (gld_${EMULATION_NAME}_set_symbols): use bfd_vma instead of long.. + * pe-dll.c (pe_dll_generate_def_file): Use fprintf_vma to print ImageBase. + (quick_reloc): Change argument address from int to bfd_size_type. + 2008-05-08 Tom Tromey <tromey@redhat.com> * ld.texinfo (PowerPC64 ELF64): Fix typo. diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index e32f6eb..93190a1 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -245,7 +245,7 @@ typedef struct { void *ptr; int size; - int value; + bfd_vma value; char *symbol; int inited; } definfo; @@ -331,7 +331,7 @@ gld_${EMULATION_NAME}_list_options (FILE *file) static void -set_pep_name (char *name, long val) +set_pep_name (char *name, bfd_vma val) { int i; @@ -461,7 +461,7 @@ set_pep_value (char *name) { char *end; - set_pep_name (name, strtoul (optarg, &end, 0)); + set_pep_name (name, (bfd_vma) strtoull (optarg, &end, 0)); if (end == optarg) einfo (_("%P%F: invalid hex number for PE parameter '%s'\n"), optarg); @@ -640,10 +640,10 @@ strhash (const char *str) /* Use the output file to create a image base for relocatable DLLs. */ -static unsigned long +static bfd_vma compute_dll_image_base (const char *ofile) { - unsigned long hash = strhash (ofile); + bfd_vma hash = (bfd_vma) strhash (ofile); return 0x61300000 + ((hash << 16) & 0x0FFC0000); } #endif @@ -686,16 +686,16 @@ gld_${EMULATION_NAME}_set_symbols (void) for (j = 0; init[j].ptr; j++) { - long val = init[j].value; + bfd_vma val = init[j].value; lang_assignment_statement_type *rv; rv = lang_add_assignment (exp_assop ('=', init[j].symbol, exp_intop (val))); if (init[j].size == sizeof (short)) - *(short *) init[j].ptr = val; + *(short *) init[j].ptr = (short) val; else if (init[j].size == sizeof (int)) - *(int *) init[j].ptr = val; + *(int *) init[j].ptr = (int) val; else if (init[j].size == sizeof (long)) - *(long *) init[j].ptr = val; + *(long *) init[j].ptr = (long) val; /* This might be a long long or other special type. */ else if (init[j].size == sizeof (bfd_vma)) *(bfd_vma *) init[j].ptr = val; diff --git a/ld/pe-dll.c b/ld/pe-dll.c index 4168aaa..aab6aea 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -1447,9 +1447,10 @@ pe_dll_generate_def_file (const char *pe_out_def_filename) quoteput (pe_def_file->name, out, 1); if (pe_data (link_info.output_bfd)->pe_opthdr.ImageBase) - fprintf (out, " BASE=0x%lx", - (unsigned long) - pe_data (link_info.output_bfd)->pe_opthdr.ImageBase); + { + fprintf (out, " BASE=0x"); + fprintf_vma (out, ((bfd_vma) pe_data (link_info.output_bfd)->pe_opthdr.ImageBase)); + } fprintf (out, "\n"); } @@ -1642,7 +1643,7 @@ static arelent *reltab = 0; static int relcount = 0, relsize = 0; static void -quick_reloc (bfd *abfd, int address, int which_howto, int symidx) +quick_reloc (bfd *abfd, bfd_size_type address, int which_howto, int symidx) { if (relcount >= relsize - 1) { |