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

« back to all changes in this revision

Viewing changes to bfd/elf32-bfin.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:
34
34
     bfd *abfd ATTRIBUTE_UNUSED,
35
35
     arelent *reloc_entry ATTRIBUTE_UNUSED,
36
36
     asymbol *symbol ATTRIBUTE_UNUSED,
37
 
     PTR data ATTRIBUTE_UNUSED,
 
37
     void * data ATTRIBUTE_UNUSED,
38
38
     asection *input_section ATTRIBUTE_UNUSED,
39
39
     bfd *output_bfd ATTRIBUTE_UNUSED,
40
40
     char **error_message ATTRIBUTE_UNUSED)
48
48
bfin_pcrel24_reloc (bfd *abfd,
49
49
                    arelent *reloc_entry,
50
50
                    asymbol *symbol,
51
 
                    PTR data,
 
51
                    void * data,
52
52
                    asection *input_section,
53
53
                    bfd *output_bfd,
54
54
                    char **error_message ATTRIBUTE_UNUSED)
145
145
bfin_imm16_reloc (bfd *abfd,
146
146
                  arelent *reloc_entry,
147
147
                  asymbol *symbol,
148
 
                  PTR data,
 
148
                  void * data,
149
149
                  asection *input_section,
150
150
                  bfd *output_bfd,
151
151
                  char **error_message ATTRIBUTE_UNUSED)
217
217
bfin_byte4_reloc (bfd *abfd,
218
218
                  arelent *reloc_entry,
219
219
                  asymbol *symbol,
220
 
                  PTR data,
 
220
                  void * data,
221
221
                  asection *input_section,
222
222
                  bfd *output_bfd,
223
223
                  char **error_message ATTRIBUTE_UNUSED)
283
283
bfin_bfd_reloc (bfd *abfd,
284
284
                arelent *reloc_entry,
285
285
                asymbol *symbol,
286
 
                PTR data,
 
286
                void * data,
287
287
                asection *input_section,
288
288
                bfd *output_bfd,
289
289
                char **error_message ATTRIBUTE_UNUSED)
1109
1109
/* Given a bfin relocation type, return the howto.  */
1110
1110
static reloc_howto_type *
1111
1111
bfin_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
1112
 
                            unsigned int r_type)
 
1112
                        unsigned int r_type)
1113
1113
{
1114
1114
  if (r_type <= BFIN_RELOC_MAX)
1115
1115
    return &bfin_howto_table [r_type];
1139
1139
/* Return TRUE if the name is a local label.
1140
1140
   bfin local labels begin with L$.  */
1141
1141
static bfd_boolean
1142
 
bfin_is_local_label_name (
1143
 
     bfd *abfd,
1144
 
     const char *label)
 
1142
bfin_is_local_label_name (bfd *abfd, const char *label)
1145
1143
{
1146
1144
  if (label[0] == 'L' && label[1] == '$' )
1147
1145
    return TRUE;
1167
1165
  const Elf_Internal_Rela *rel_end;
1168
1166
  asection *sgot;
1169
1167
  asection *srelgot;
 
1168
 
1170
1169
  if (info->relocatable)
1171
1170
    return TRUE;
1172
1171
 
1997
1996
   for memory allocation purposes.  */
1998
1997
inline static struct bfinfdpic_relocs_info *
1999
1998
bfinfdpic_relocs_info_for_global (struct htab *ht,
2000
 
                                 bfd *abfd,
2001
 
                                 struct elf_link_hash_entry *h,
2002
 
                                 bfd_vma addend,
2003
 
                                 enum insert_option insert)
 
1999
                                  bfd *abfd,
 
2000
                                  struct elf_link_hash_entry *h,
 
2001
                                  bfd_vma addend,
 
2002
                                  enum insert_option insert)
2004
2003
{
2005
2004
  struct bfinfdpic_relocs_info entry;
2006
2005
 
2035
2034
 
2036
2035
inline static void
2037
2036
bfinfdpic_pic_merge_early_relocs_info (struct bfinfdpic_relocs_info *e2,
2038
 
                                      struct bfinfdpic_relocs_info const *e1)
 
2037
                                       struct bfinfdpic_relocs_info const *e1)
2039
2038
{
2040
2039
  e2->got17m4 |= e1->got17m4;
2041
2040
  e2->gothilo |= e1->gothilo;
2101
2100
 
2102
2101
static bfd_vma
2103
2102
_bfinfdpic_add_rofixup (bfd *output_bfd, asection *rofixup, bfd_vma offset,
2104
 
                       struct bfinfdpic_relocs_info *entry)
 
2103
                        struct bfinfdpic_relocs_info *entry)
2105
2104
{
2106
2105
  bfd_vma fixup_offset;
2107
2106
 
2156
2155
                                        asection *sec,
2157
2156
                                        Elf_Internal_Sym *sym,
2158
2157
                                        bfd_vma addend)
2159
 
 
2160
2158
{
2161
 
  bfd_vma fd_lazy_rel_offset = (bfd_vma)-1;
 
2159
  bfd_vma fd_lazy_rel_offset = (bfd_vma) -1;
2162
2160
  int dynindx = -1;
2163
2161
 
2164
2162
  if (entry->done)
4350
4348
   subtract it from the relocation or fixup count.  */
4351
4349
static bfd_boolean
4352
4350
_bfinfdpic_check_discarded_relocs (bfd *abfd, asection *sec,
4353
 
                                  struct bfd_link_info *info,
4354
 
                                  
4355
 
                                  bfd_boolean *changed)
 
4351
                                   struct bfd_link_info *info,
 
4352
                                   bfd_boolean *changed)
4356
4353
{
4357
4354
  Elf_Internal_Shdr *symtab_hdr;
4358
4355
  struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
4600
4597
   regular object.  */
4601
4598
 
4602
4599
static bfd_boolean
4603
 
elf32_bfinfdpic_adjust_dynamic_symbol
4604
 
(struct bfd_link_info *info,
4605
 
 struct elf_link_hash_entry *h)
 
4600
elf32_bfinfdpic_adjust_dynamic_symbol (struct bfd_link_info *info,
 
4601
                                       struct elf_link_hash_entry *h)
4606
4602
{
4607
4603
  bfd * dynobj;
4608
4604
 
5065
5061
 
5066
5062
/* Display the flags field.  */
5067
5063
static bfd_boolean
5068
 
elf32_bfin_print_private_bfd_data (bfd * abfd, PTR ptr)
 
5064
elf32_bfin_print_private_bfd_data (bfd * abfd, void * ptr)
5069
5065
{
5070
5066
  FILE *file = (FILE *) ptr;
5071
5067
  flagword flags;
5213
5209
 
5214
5210
static bfd_boolean
5215
5211
bfin_finish_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
5216
 
                                  struct bfd_link_info *info)
 
5212
                              struct bfd_link_info *info)
5217
5213
{
5218
5214
  bfd *dynobj;
5219
5215
  asection *sdyn;
5247
5243
 
5248
5244
static bfd_boolean
5249
5245
bfin_finish_dynamic_symbol (bfd * output_bfd,
5250
 
                                struct bfd_link_info *info,
5251
 
                                struct elf_link_hash_entry *h,
5252
 
                                Elf_Internal_Sym * sym)
 
5246
                            struct bfd_link_info *info,
 
5247
                            struct elf_link_hash_entry *h,
 
5248
                            Elf_Internal_Sym * sym)
5253
5249
{
5254
5250
  bfd *dynobj;
5255
5251
 
5324
5320
 
5325
5321
static bfd_boolean
5326
5322
bfin_adjust_dynamic_symbol (struct bfd_link_info *info,
5327
 
                                struct elf_link_hash_entry *h)
 
5323
                            struct elf_link_hash_entry *h)
5328
5324
{
5329
5325
  bfd *dynobj;
5330
5326
  asection *s;
5452
5448
   case.  */
5453
5449
 
5454
5450
static bfd_boolean
5455
 
bfin_discard_copies (struct elf_link_hash_entry *h, PTR inf)
 
5451
bfin_discard_copies (struct elf_link_hash_entry *h, void * inf)
5456
5452
{
5457
5453
  struct bfd_link_info *info = (struct bfd_link_info *) inf;
5458
5454
  struct bfin_pcrel_relocs_copied *s;
5483
5479
 
5484
5480
static bfd_boolean
5485
5481
bfin_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
5486
 
                                struct bfd_link_info *info)
 
5482
                            struct bfd_link_info *info)
5487
5483
{
5488
5484
  bfd *dynobj;
5489
5485
  asection *s;
5523
5519
     will not fill them in in the relocate_section routine.  */
5524
5520
  if (info->shared)
5525
5521
    elf_link_hash_traverse (elf_hash_table (info),
5526
 
                            bfin_discard_copies, (PTR) info);
 
5522
                            bfin_discard_copies, info);
5527
5523
 
5528
5524
  /* The check_relocs and adjust_dynamic_symbol entry points have
5529
5525
     determined the sizes of the various dynamic sections.  Allocate
5634
5630
   after the add_symbols entry point has been called for all the
5635
5631
   objects, and before the final_link entry point is called.  */
5636
5632
 
5637
 
bfd_boolean bfd_bfin_elf32_create_embedded_relocs
5638
 
  PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *, char **));
5639
 
 
5640
5633
bfd_boolean
5641
 
bfd_bfin_elf32_create_embedded_relocs (
5642
 
     bfd *abfd,
5643
 
     struct bfd_link_info *info,
5644
 
     asection *datasec,
5645
 
     asection *relsec,
5646
 
     char **errmsg)
 
5634
bfd_bfin_elf32_create_embedded_relocs (bfd *abfd,
 
5635
                                       struct bfd_link_info *info,
 
5636
                                       asection *datasec,
 
5637
                                       asection *relsec,
 
5638
                                       char **errmsg)
5647
5639
{
5648
5640
  Elf_Internal_Shdr *symtab_hdr;
5649
5641
  Elf_Internal_Sym *isymbuf = NULL;
5663
5655
 
5664
5656
  /* Get a copy of the native relocations.  */
5665
5657
  internal_relocs = (_bfd_elf_link_read_relocs
5666
 
                     (abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
 
5658
                     (abfd, datasec, NULL, (Elf_Internal_Rela *) NULL,
5667
5659
                      info->keep_memory));
5668
5660
  if (internal_relocs == NULL)
5669
5661
    goto error_return;