aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-09-18 10:10:21 +0000
committerAlan Modra <amodra@gmail.com>2001-09-18 10:10:21 +0000
commitdb09f25b32e3a437a72c0bcc4ec67bb97d16e81b (patch)
tree2e779aa55a1c9d8b6c667b98057103535ea8d1ff /ld/emultempl
parent0e1a166b287f476e03396c78184211720765aa5e (diff)
downloadgdb-db09f25b32e3a437a72c0bcc4ec67bb97d16e81b.zip
gdb-db09f25b32e3a437a72c0bcc4ec67bb97d16e81b.tar.gz
gdb-db09f25b32e3a437a72c0bcc4ec67bb97d16e81b.tar.bz2
* deffilep.y (def_stash_module): Constify "name" param.
* pe-dll.c: Replace CONST with const throughout. (quick_symbol): Constify "n1", "n2", "n3" params. (make_singleton_name_thunk): Constify "import" param. Make "buffer_len" a size_t. (make_import_fixup_entry): Constify "name", "fixup_name", "dll_symname" params. (pe_get16): Cast args of bfd_seek. Replace bfd_read with bfd_bread. (pe_get32): Likewise. (pe_implied_import_dll): Likewise. * emultempl/beos.em (sort_by_file_name): Constify "ra", "rb". (sort_by_section_name): Likewise. * emultempl/pe.em: Move defines for arm_epoc_pe before bfd.h included. (make_import_fixup): Cast printf arg, rel->address to long rather than int. (gld_${EMULATION_NAME}_after_open): Don't compare NULL against int.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/beos.em8
-rw-r--r--ld/emultempl/pe.em29
2 files changed, 19 insertions, 18 deletions
diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em
index 085edc8..cbff05c 100644
--- a/ld/emultempl/beos.em
+++ b/ld/emultempl/beos.em
@@ -461,8 +461,8 @@ sort_by_file_name (a, b)
const PTR a;
const PTR b;
{
- lang_statement_union_type **ra = a;
- lang_statement_union_type **rb = b;
+ const lang_statement_union_type *const *ra = a;
+ const lang_statement_union_type *const *rb = b;
int i, a_sec, b_sec;
i = strcmp ((*ra)->input_section.ifile->the_bfd->my_archive->filename,
@@ -518,8 +518,8 @@ sort_by_section_name (a, b)
const PTR a;
const PTR b;
{
- lang_statement_union_type **ra = a;
- lang_statement_union_type **rb = b;
+ const lang_statement_union_type *const *ra = a;
+ const lang_statement_union_type *const *rb = b;
int i;
i = strcmp ((*ra)->input_section.section->name,
(*rb)->input_section.section->name);
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 093c081..990b6a7 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -33,6 +33,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
only determine if the subsystem is console or windows in order to select
the correct entry point by default. */
+#define TARGET_IS_${EMULATION_NAME}
+
+/* Do this before including bfd.h, so we prototype the right functions. */
+#ifdef TARGET_IS_arm_epoc_pe
+#define bfd_arm_pe_allocate_interworking_sections \
+ bfd_arm_epoc_pe_allocate_interworking_sections
+#define bfd_arm_pe_get_bfd_for_interworking \
+ bfd_arm_epoc_pe_get_bfd_for_interworking
+#define bfd_arm_pe_process_before_allocation \
+ bfd_arm_epoc_pe_process_before_allocation
+#endif
+
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
@@ -59,8 +71,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <ctype.h>
-#define TARGET_IS_${EMULATION_NAME}
-
/* Permit the emulation parameters to override the default section
alignment by setting OVERRIDE_SECTION_ALIGNMENT. FIXME: This makes
it seem that include/coff/internal.h should not define
@@ -94,15 +104,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define PE_DEF_FILE_ALIGNMENT 0x00000200
#endif
-#ifdef TARGET_IS_arm_epoc_pe
-#define bfd_arm_pe_allocate_interworking_sections \
- bfd_arm_epoc_pe_allocate_interworking_sections
-#define bfd_arm_pe_get_bfd_for_interworking \
- bfd_arm_epoc_pe_get_bfd_for_interworking
-#define bfd_arm_pe_process_before_allocation \
- bfd_arm_epoc_pe_process_before_allocation
-#endif
-
static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void));
static void gld_${EMULATION_NAME}_after_open PARAMS ((void));
static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
@@ -853,8 +854,8 @@ make_import_fixup (rel, s)
if (pe_dll_extra_pe_debug)
{
- printf ("arelent: %s@%#x: add=%li\n", sym->name,
- (int) rel->address, rel->addend);
+ printf ("arelent: %s@%#lx: add=%li\n", sym->name,
+ (long) rel->address, (long) rel->addend);
}
{
@@ -979,7 +980,7 @@ gld_${EMULATION_NAME}_after_open ()
FIXME: This should be done via a function, rather than by
including an internal BFD header. */
- if (coff_data (output_bfd) == NULL || coff_data (output_bfd)->pe == NULL)
+ if (coff_data (output_bfd) == NULL || coff_data (output_bfd)->pe == 0)
einfo (_("%F%P: PE operations on non PE file.\n"));
pe_data (output_bfd)->pe_opthdr = pe;