~ubuntu-branches/debian/experimental/binutils/experimental

« back to all changes in this revision

Viewing changes to bfd/coff-i386.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-07-31 22:20:22 UTC
  • mfrom: (1.7.10)
  • Revision ID: package-import@ubuntu.com-20120731222022-0anxbeg8at8rnrx1
Tags: 2.22.90.20120731-1
New upstream snapshot (taken from the 2.23 branch).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* BFD back-end for Intel 386 COFF files.
2
2
   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3
 
   2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
 
3
   2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012
4
4
   Free Software Foundation, Inc.
5
5
   Written by Cygnus Support.
6
6
 
43
43
 
44
44
#include "libcoff.h"
45
45
 
46
 
static bfd_reloc_status_type coff_i386_reloc
47
 
  (bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **);
48
46
static reloc_howto_type *coff_i386_rtype_to_howto
49
47
  (bfd *, asection *, struct internal_reloc *,
50
48
   struct coff_link_hash_entry *, struct internal_syment *,
67
65
   reloc type to make any required adjustments.  */
68
66
 
69
67
static bfd_reloc_status_type
70
 
coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
71
 
                 error_message)
72
 
     bfd *abfd;
73
 
     arelent *reloc_entry;
74
 
     asymbol *symbol;
75
 
     PTR data;
76
 
     asection *input_section ATTRIBUTE_UNUSED;
77
 
     bfd *output_bfd;
78
 
     char **error_message ATTRIBUTE_UNUSED;
 
68
coff_i386_reloc (bfd *abfd,
 
69
                 arelent *reloc_entry,
 
70
                 asymbol *symbol,
 
71
                 void * data,
 
72
                 asection *input_section ATTRIBUTE_UNUSED,
 
73
                 bfd *output_bfd,
 
74
                 char **error_message ATTRIBUTE_UNUSED)
79
75
{
80
76
  symvalue diff;
81
77
 
189
185
/* Return TRUE if this relocation should appear in the output .reloc
190
186
   section.  */
191
187
 
192
 
static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
193
 
 
194
 
static bfd_boolean in_reloc_p (abfd, howto)
195
 
     bfd * abfd ATTRIBUTE_UNUSED;
196
 
     reloc_howto_type *howto;
 
188
static bfd_boolean in_reloc_p (bfd * abfd ATTRIBUTE_UNUSED,
 
189
                               reloc_howto_type *howto)
197
190
{
198
191
  return ! howto->pc_relative && howto->type != R_IMAGEBASE
199
192
         && howto->type != R_SECREL32;
413
406
   and the regular routine is that we don't want to do anything for a
414
407
   relocatable link.  */
415
408
 
416
 
static bfd_boolean coff_pe_i386_relocate_section
417
 
  PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
418
 
           struct internal_reloc *, struct internal_syment *, asection **));
419
 
 
420
409
static bfd_boolean
421
 
coff_pe_i386_relocate_section (output_bfd, info, input_bfd,
422
 
                               input_section, contents, relocs, syms,
423
 
                               sections)
424
 
     bfd *output_bfd;
425
 
     struct bfd_link_info *info;
426
 
     bfd *input_bfd;
427
 
     asection *input_section;
428
 
     bfd_byte *contents;
429
 
     struct internal_reloc *relocs;
430
 
     struct internal_syment *syms;
431
 
     asection **sections;
 
410
coff_pe_i386_relocate_section (bfd *output_bfd,
 
411
                               struct bfd_link_info *info,
 
412
                               bfd *input_bfd,
 
413
                               asection *input_section,
 
414
                               bfd_byte *contents,
 
415
                               struct internal_reloc *relocs,
 
416
                               struct internal_syment *syms,
 
417
                               asection **sections)
432
418
{
433
419
  if (info->relocatable)
434
420
    return TRUE;
445
431
/* Convert an rtype to howto for the COFF backend linker.  */
446
432
 
447
433
static reloc_howto_type *
448
 
coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
449
 
     bfd *abfd ATTRIBUTE_UNUSED;
450
 
     asection *sec;
451
 
     struct internal_reloc *rel;
452
 
     struct coff_link_hash_entry *h;
453
 
     struct internal_syment *sym;
454
 
     bfd_vma *addendp;
 
434
coff_i386_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
 
435
                          asection *sec,
 
436
                          struct internal_reloc *rel,
 
437
                          struct coff_link_hash_entry *h,
 
438
                          struct internal_syment *sym,
 
439
                          bfd_vma *addendp)
455
440
{
456
441
  reloc_howto_type *howto;
457
442
 
556
541
#define coff_bfd_reloc_name_lookup coff_i386_reloc_name_lookup
557
542
 
558
543
static reloc_howto_type *
559
 
coff_i386_reloc_type_lookup (abfd, code)
560
 
     bfd *abfd ATTRIBUTE_UNUSED;
561
 
     bfd_reloc_code_real_type code;
 
544
coff_i386_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 
545
                             bfd_reloc_code_real_type code)
562
546
{
563
547
  switch (code)
564
548
    {
608
592
   a leading dot for local labels, so if TARGET_UNDERSCORE is defined
609
593
   we treat all symbols starting with L as local.  */
610
594
 
611
 
static bfd_boolean coff_i386_is_local_label_name
612
 
  PARAMS ((bfd *, const char *));
613
 
 
614
595
static bfd_boolean
615
 
coff_i386_is_local_label_name (abfd, name)
616
 
     bfd *abfd;
617
 
     const char *name;
 
596
coff_i386_is_local_label_name (bfd *abfd, const char *name)
618
597
{
619
598
  if (name[0] == 'L')
620
599
    return TRUE;