~ubuntu-branches/debian/squeeze/binutils/squeeze

« back to all changes in this revision

Viewing changes to gas/config/tc-ppc.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-09-10 17:05:30 UTC
  • mfrom: (1.4.5 upstream) (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090910170530-wa6gpju9pq5c56on
Tags: 2.19.91.20090910-1
* Snapshot, taken from the 2.20 release branch 20090910, corresponding
  to the 2.19.90 upstream snapshot.
* Fix Thumb-2 shared libraries (Daniel Jacobowitz), patch taken
  from the trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3338
3338
  if (S_GET_NAME (sym)[0] == '\0')
3339
3339
    {
3340
3340
      /* An unnamed csect is assumed to be [PR].  */
3341
 
      symbol_get_tc (sym)->class = XMC_PR;
 
3341
      symbol_get_tc (sym)->symbol_class = XMC_PR;
3342
3342
    }
3343
3343
 
3344
3344
  align = 2;
3374
3374
         data section.  */
3375
3375
      after_toc = 0;
3376
3376
      is_code = 0;
3377
 
      switch (symbol_get_tc (sym)->class)
 
3377
      switch (symbol_get_tc (sym)->symbol_class)
3378
3378
        {
3379
3379
        case XMC_PR:
3380
3380
        case XMC_RO:
3764
3764
      symbol_set_value_expression (ext_sym, &exp);
3765
3765
    }
3766
3766
 
3767
 
  if (symbol_get_tc (ext_sym)->class == -1)
3768
 
    symbol_get_tc (ext_sym)->class = XMC_PR;
 
3767
  if (symbol_get_tc (ext_sym)->symbol_class == -1)
 
3768
    symbol_get_tc (ext_sym)->symbol_class = XMC_PR;
3769
3769
  symbol_get_tc (ext_sym)->output = 1;
3770
3770
 
3771
3771
  if (*input_line_pointer == ',')
4198
4198
        symbolS *label;
4199
4199
 
4200
4200
        label = symbol_get_tc (ppc_current_csect)->within;
4201
 
        if (symbol_get_tc (label)->class != XMC_TC0)
 
4201
        if (symbol_get_tc (label)->symbol_class != XMC_TC0)
4202
4202
          {
4203
4203
            as_bad (_(".tc with no label"));
4204
4204
            ignore_rest_of_line ();
4218
4218
    S_SET_SEGMENT (sym, now_seg);
4219
4219
    symbol_set_frag (sym, frag_now);
4220
4220
    S_SET_VALUE (sym, (valueT) frag_now_fix ());
4221
 
    symbol_get_tc (sym)->class = XMC_TC;
 
4221
    symbol_get_tc (sym)->symbol_class = XMC_TC;
4222
4222
    symbol_get_tc (sym)->output = 1;
4223
4223
 
4224
4224
    ppc_frob_label (sym);
4322
4322
ppc_is_toc_sym (symbolS *sym)
4323
4323
{
4324
4324
#ifdef OBJ_XCOFF
4325
 
  return symbol_get_tc (sym)->class == XMC_TC;
 
4325
  return symbol_get_tc (sym)->symbol_class == XMC_TC;
4326
4326
#endif
4327
4327
#ifdef OBJ_ELF
4328
4328
  const char *sname = segment_name (S_GET_SEGMENT (sym));
4972
4972
  tc = symbol_get_tc (sym);
4973
4973
  tc->next = NULL;
4974
4974
  tc->output = 0;
4975
 
  tc->class = -1;
 
4975
  tc->symbol_class = -1;
4976
4976
  tc->real_name = NULL;
4977
4977
  tc->subseg = 0;
4978
4978
  tc->align = 0;
4995
4995
    {
4996
4996
    case 'B':
4997
4997
      if (strcmp (s, "BS]") == 0)
4998
 
        tc->class = XMC_BS;
 
4998
        tc->symbol_class = XMC_BS;
4999
4999
      break;
5000
5000
    case 'D':
5001
5001
      if (strcmp (s, "DB]") == 0)
5002
 
        tc->class = XMC_DB;
 
5002
        tc->symbol_class = XMC_DB;
5003
5003
      else if (strcmp (s, "DS]") == 0)
5004
 
        tc->class = XMC_DS;
 
5004
        tc->symbol_class = XMC_DS;
5005
5005
      break;
5006
5006
    case 'G':
5007
5007
      if (strcmp (s, "GL]") == 0)
5008
 
        tc->class = XMC_GL;
 
5008
        tc->symbol_class = XMC_GL;
5009
5009
      break;
5010
5010
    case 'P':
5011
5011
      if (strcmp (s, "PR]") == 0)
5012
 
        tc->class = XMC_PR;
 
5012
        tc->symbol_class = XMC_PR;
5013
5013
      break;
5014
5014
    case 'R':
5015
5015
      if (strcmp (s, "RO]") == 0)
5016
 
        tc->class = XMC_RO;
 
5016
        tc->symbol_class = XMC_RO;
5017
5017
      else if (strcmp (s, "RW]") == 0)
5018
 
        tc->class = XMC_RW;
 
5018
        tc->symbol_class = XMC_RW;
5019
5019
      break;
5020
5020
    case 'S':
5021
5021
      if (strcmp (s, "SV]") == 0)
5022
 
        tc->class = XMC_SV;
 
5022
        tc->symbol_class = XMC_SV;
5023
5023
      break;
5024
5024
    case 'T':
5025
5025
      if (strcmp (s, "TC]") == 0)
5026
 
        tc->class = XMC_TC;
 
5026
        tc->symbol_class = XMC_TC;
5027
5027
      else if (strcmp (s, "TI]") == 0)
5028
 
        tc->class = XMC_TI;
 
5028
        tc->symbol_class = XMC_TI;
5029
5029
      else if (strcmp (s, "TB]") == 0)
5030
 
        tc->class = XMC_TB;
 
5030
        tc->symbol_class = XMC_TB;
5031
5031
      else if (strcmp (s, "TC0]") == 0 || strcmp (s, "T0]") == 0)
5032
 
        tc->class = XMC_TC0;
 
5032
        tc->symbol_class = XMC_TC0;
5033
5033
      break;
5034
5034
    case 'U':
5035
5035
      if (strcmp (s, "UA]") == 0)
5036
 
        tc->class = XMC_UA;
 
5036
        tc->symbol_class = XMC_UA;
5037
5037
      else if (strcmp (s, "UC]") == 0)
5038
 
        tc->class = XMC_UC;
 
5038
        tc->symbol_class = XMC_UC;
5039
5039
      break;
5040
5040
    case 'X':
5041
5041
      if (strcmp (s, "XO]") == 0)
5042
 
        tc->class = XMC_XO;
 
5042
        tc->symbol_class = XMC_XO;
5043
5043
      break;
5044
5044
    }
5045
5045
 
5046
 
  if (tc->class == -1)
 
5046
  if (tc->symbol_class == -1)
5047
5047
    as_bad (_("Unrecognized symbol suffix"));
5048
5048
}
5049
5049
 
5056
5056
{
5057
5057
  if (ppc_current_csect != (symbolS *) NULL)
5058
5058
    {
5059
 
      if (symbol_get_tc (sym)->class == -1)
5060
 
        symbol_get_tc (sym)->class = symbol_get_tc (ppc_current_csect)->class;
 
5059
      if (symbol_get_tc (sym)->symbol_class == -1)
 
5060
        symbol_get_tc (sym)->symbol_class = symbol_get_tc (ppc_current_csect)->symbol_class;
5061
5061
 
5062
5062
      symbol_remove (sym, &symbol_rootP, &symbol_lastP);
5063
5063
      symbol_append (sym, symbol_get_tc (ppc_current_csect)->within,
5180
5180
      i = S_GET_NUMBER_AUXILIARY (sym);
5181
5181
      S_SET_NUMBER_AUXILIARY (sym, i + 1);
5182
5182
      a = &coffsymbol (symbol_get_bfdsym (sym))->native[i + 1].u.auxent;
5183
 
      if (symbol_get_tc (sym)->class == XMC_TC0)
 
5183
      if (symbol_get_tc (sym)->symbol_class == XMC_TC0)
5184
5184
        {
5185
5185
          /* This is the TOC table.  */
5186
5186
          know (strcmp (S_GET_NAME (sym), "TOC") == 0);
5209
5209
          a->x_csect.x_scnlen.l = symbol_get_frag (sym)->fr_offset;
5210
5210
          a->x_csect.x_smtyp = (symbol_get_tc (sym)->align << 3) | XTY_CM;
5211
5211
          if (S_IS_EXTERNAL (sym))
5212
 
            symbol_get_tc (sym)->class = XMC_RW;
 
5212
            symbol_get_tc (sym)->symbol_class = XMC_RW;
5213
5213
          else
5214
 
            symbol_get_tc (sym)->class = XMC_BS;
 
5214
            symbol_get_tc (sym)->symbol_class = XMC_BS;
5215
5215
        }
5216
5216
      else if (S_GET_SEGMENT (sym) == absolute_section)
5217
5217
        {
5219
5219
             ppc_adjust_symtab.  */
5220
5220
          ppc_saw_abs = TRUE;
5221
5221
          a->x_csect.x_smtyp = XTY_LD;
5222
 
          if (symbol_get_tc (sym)->class == -1)
5223
 
            symbol_get_tc (sym)->class = XMC_XO;
 
5222
          if (symbol_get_tc (sym)->symbol_class == -1)
 
5223
            symbol_get_tc (sym)->symbol_class = XMC_XO;
5224
5224
        }
5225
5225
      else if (! S_IS_DEFINED (sym))
5226
5226
        {
5228
5228
          a->x_csect.x_scnlen.l = 0;
5229
5229
          a->x_csect.x_smtyp = XTY_ER;
5230
5230
        }
5231
 
      else if (symbol_get_tc (sym)->class == XMC_TC)
 
5231
      else if (symbol_get_tc (sym)->symbol_class == XMC_TC)
5232
5232
        {
5233
5233
          symbolS *next;
5234
5234
 
5235
5235
          /* This is a TOC definition.  x_scnlen is the size of the
5236
5236
             TOC entry.  */
5237
5237
          next = symbol_next (sym);
5238
 
          while (symbol_get_tc (next)->class == XMC_TC0)
 
5238
          while (symbol_get_tc (next)->symbol_class == XMC_TC0)
5239
5239
            next = symbol_next (next);
5240
5240
          if (next == (symbolS *) NULL
5241
 
              || symbol_get_tc (next)->class != XMC_TC)
 
5241
              || symbol_get_tc (next)->symbol_class != XMC_TC)
5242
5242
            {
5243
5243
              if (ppc_after_toc_frag == (fragS *) NULL)
5244
5244
                a->x_csect.x_scnlen.l = (bfd_section_size (stdoutput,
5298
5298
 
5299
5299
      a->x_csect.x_parmhash = 0;
5300
5300
      a->x_csect.x_snhash = 0;
5301
 
      if (symbol_get_tc (sym)->class == -1)
 
5301
      if (symbol_get_tc (sym)->symbol_class == -1)
5302
5302
        a->x_csect.x_smclas = XMC_PR;
5303
5303
      else
5304
 
        a->x_csect.x_smclas = symbol_get_tc (sym)->class;
 
5304
        a->x_csect.x_smclas = symbol_get_tc (sym)->symbol_class;
5305
5305
      a->x_csect.x_stab = 0;
5306
5306
      a->x_csect.x_snstab = 0;
5307
5307
 
5506
5506
        {
5507
5507
          TC_SYMFIELD_TYPE *sy_tc = symbol_get_tc (sy);
5508
5508
 
5509
 
          if (sy_tc->class == XMC_TC0)
 
5509
          if (sy_tc->symbol_class == XMC_TC0)
5510
5510
            continue;
5511
 
          if (sy_tc->class != XMC_TC)
 
5511
          if (sy_tc->symbol_class != XMC_TC)
5512
5512
            break;
5513
5513
          if (val == resolve_symbol_value (sy))
5514
5514
            {
5525
5525
  /* Possibly adjust the reloc to be against the csect.  */
5526
5526
  tc = symbol_get_tc (fix->fx_addsy);
5527
5527
  if (tc->subseg == 0
5528
 
      && tc->class != XMC_TC0
5529
 
      && tc->class != XMC_TC
 
5528
      && tc->symbol_class != XMC_TC0
 
5529
      && tc->symbol_class != XMC_TC
5530
5530
      && symseg != bss_section
5531
5531
      /* Don't adjust if this is a reloc in the toc section.  */
5532
5532
      && (symseg != data_section
5791
5791
          && (operand->insert == NULL || ppc_obj64)
5792
5792
          && fixP->fx_addsy != NULL
5793
5793
          && symbol_get_tc (fixP->fx_addsy)->subseg != 0
5794
 
          && symbol_get_tc (fixP->fx_addsy)->class != XMC_TC
5795
 
          && symbol_get_tc (fixP->fx_addsy)->class != XMC_TC0
 
5794
          && symbol_get_tc (fixP->fx_addsy)->symbol_class != XMC_TC
 
5795
          && symbol_get_tc (fixP->fx_addsy)->symbol_class != XMC_TC0
5796
5796
          && S_GET_SEGMENT (fixP->fx_addsy) != bss_section)
5797
5797
        {
5798
5798
          value = fixP->fx_offset;