View | Details | Raw Unified | Return to bug 25380
Collapse All | Expand All

(-)a/bfd/bfd-in2.h (-2 / +7 lines)
Lines 795-800 typedef struct bfd_section Link Here
795
  /* A unique sequence number.  */
795
  /* A unique sequence number.  */
796
  unsigned int id;
796
  unsigned int id;
797
797
798
  /* A unique section number used by assembler to identify a section
799
     with the same section name.  (unsigned int) -1 indicates that
800
     the section_id field is unused.  */
801
  unsigned int section_id;
802
798
  /* Which section in the bfd; 0..n-1 as sections are created in a bfd.  */
803
  /* Which section in the bfd; 0..n-1 as sections are created in a bfd.  */
799
  unsigned int index;
804
  unsigned int index;
800
805
Lines 1329-1336 discarded_section (const asection *sec) Link Here
1329
}
1334
}
1330
1335
1331
#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS)                   \
1336
#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS)                   \
1332
  /* name, id,  index, next, prev, flags, user_set_vma,            */  \
1337
  /* name, id,  section_id, index, next, prev, flags, user_set_vma, */ \
1333
  {  NAME, IDX, 0,     NULL, NULL, FLAGS, 0,                           \
1338
  {  NAME, IDX, -1,         0,     NULL, NULL, FLAGS, 0,               \
1334
                                                                       \
1339
                                                                       \
1335
  /* linker_mark, linker_has_input, gc_mark, decompress_status,    */  \
1340
  /* linker_mark, linker_has_input, gc_mark, decompress_status,    */  \
1336
     0,           0,                1,       0,                        \
1341
     0,           0,                1,       0,                        \
(-)a/bfd/section.c (-2 / +8 lines)
Lines 154-159 CODE_FRAGMENT Link Here
154
.  {* A unique sequence number.  *}
154
.  {* A unique sequence number.  *}
155
.  unsigned int id;
155
.  unsigned int id;
156
.
156
.
157
.  {* A unique section number used by assembler to identify a section
158
.     with the same section name.  (unsigned int) -1 indicates that
159
.     the section_id field is unused.  *}
160
.  unsigned int section_id;
161
.
157
.  {* Which section in the bfd; 0..n-1 as sections are created in a bfd.  *}
162
.  {* Which section in the bfd; 0..n-1 as sections are created in a bfd.  *}
158
.  unsigned int index;
163
.  unsigned int index;
159
.
164
.
Lines 688-695 CODE_FRAGMENT Link Here
688
.}
693
.}
689
.
694
.
690
.#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS)			\
695
.#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS)			\
691
.  {* name, id,  index, next, prev, flags, user_set_vma,            *}	\
696
.  {* name, id,  section_id, index, next, prev, flags, user_set_vma, *}	\
692
.  {  NAME, IDX, 0,     NULL, NULL, FLAGS, 0,				\
697
.  {  NAME, IDX, -1,         0,     NULL, NULL, FLAGS, 0,		\
693
.									\
698
.									\
694
.  {* linker_mark, linker_has_input, gc_mark, decompress_status,    *}	\
699
.  {* linker_mark, linker_has_input, gc_mark, decompress_status,    *}	\
695
.     0,           0,                1,       0,			\
700
.     0,           0,                1,       0,			\
Lines 819-824 static asection * Link Here
819
bfd_section_init (bfd *abfd, asection *newsect)
824
bfd_section_init (bfd *abfd, asection *newsect)
820
{
825
{
821
  newsect->id = _bfd_section_id;
826
  newsect->id = _bfd_section_id;
827
  newsect->section_id = (unsigned int) -1;
822
  newsect->index = abfd->section_count;
828
  newsect->index = abfd->section_count;
823
  newsect->owner = abfd;
829
  newsect->owner = abfd;
824
830
(-)a/binutils/objdump.c (+7 lines)
Lines 1065-1070 sym_ok (bfd_boolean want_section, Link Here
1065
{
1065
{
1066
  if (want_section)
1066
  if (want_section)
1067
    {
1067
    {
1068
      /* NB: An object file can have different sections with the same
1069
         section name.  Compare compare section pointers if they have
1070
	 the same owner.  */
1071
      if (sorted_syms[place]->section->owner == sec->owner
1072
	  && sorted_syms[place]->section != sec)
1073
	return FALSE;
1074
1068
      /* Note - we cannot just compare section pointers because they could
1075
      /* Note - we cannot just compare section pointers because they could
1069
	 be different, but the same...  Ie the symbol that we are trying to
1076
	 be different, but the same...  Ie the symbol that we are trying to
1070
	 find could have come from a separate debug info file.  Under such
1077
	 find could have come from a separate debug info file.  Under such
(-)a/gas/config/obj-elf.c (-5 / +45 lines)
Lines 518-528 struct section_stack Link Here
518
518
519
static struct section_stack *section_stack;
519
static struct section_stack *section_stack;
520
520
521
/* Match both section group name and the sh_info field.  */
521
/* Match section group name, the sh_info field and the section_id
522
   field.  */
522
struct section_match
523
struct section_match
523
{
524
{
524
  const char *group_name;
525
  const char *group_name;
525
  unsigned int info;
526
  unsigned int info;
527
  unsigned int section_id;
526
};
528
};
527
529
528
static bfd_boolean
530
static bfd_boolean
Lines 532-539 get_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *inf) Link Here
532
  const char *gname = match->group_name;
534
  const char *gname = match->group_name;
533
  const char *group_name = elf_group_name (sec);
535
  const char *group_name = elf_group_name (sec);
534
  unsigned int info = elf_section_data (sec)->this_hdr.sh_info;
536
  unsigned int info = elf_section_data (sec)->this_hdr.sh_info;
537
  unsigned int section_id = sec->section_id;
535
538
536
  return (info == match->info
539
  return (info == match->info
540
	  && section_id == match->section_id
537
	  && (group_name == gname
541
	  && (group_name == gname
538
	      || (group_name != NULL
542
	      || (group_name != NULL
539
		  && gname != NULL
543
		  && gname != NULL
Lines 562-567 void Link Here
562
obj_elf_change_section (const char *name,
566
obj_elf_change_section (const char *name,
563
			unsigned int type,
567
			unsigned int type,
564
			unsigned int info,
568
			unsigned int info,
569
			unsigned int section_id,
565
			bfd_vma attr,
570
			bfd_vma attr,
566
			int entsize,
571
			int entsize,
567
			const char *group_name,
572
			const char *group_name,
Lines 596-601 obj_elf_change_section (const char *name, Link Here
596
601
597
  match.group_name = group_name;
602
  match.group_name = group_name;
598
  match.info = info;
603
  match.info = info;
604
  match.section_id = section_id;
599
  old_sec = bfd_get_section_by_name_if (stdoutput, name, get_section,
605
  old_sec = bfd_get_section_by_name_if (stdoutput, name, get_section,
600
					(void *) &match);
606
					(void *) &match);
601
  if (old_sec)
607
  if (old_sec)
Lines 749-754 obj_elf_change_section (const char *name, Link Here
749
	symbol_set_bfdsym (secsym, sec->symbol);
755
	symbol_set_bfdsym (secsym, sec->symbol);
750
      else
756
      else
751
	symbol_table_insert (section_symbol (sec));
757
	symbol_table_insert (section_symbol (sec));
758
759
      /* Set the section ID.  */
760
      sec->section_id = section_id;
752
    }
761
    }
753
  else
762
  else
754
    {
763
    {
Lines 1015-1020 obj_elf_section (int push) Link Here
1015
  int linkonce;
1024
  int linkonce;
1016
  subsegT new_subsection = -1;
1025
  subsegT new_subsection = -1;
1017
  unsigned int info = 0;
1026
  unsigned int info = 0;
1027
  unsigned int section_id = (unsigned int) -1;
1018
1028
1019
  if (flag_mri)
1029
  if (flag_mri)
1020
    {
1030
    {
Lines 1198-1205 obj_elf_section (int push) Link Here
1198
	      if (ISDIGIT (* input_line_pointer))
1208
	      if (ISDIGIT (* input_line_pointer))
1199
		{
1209
		{
1200
		  char *t = input_line_pointer;
1210
		  char *t = input_line_pointer;
1201
		  info = strtoul (input_line_pointer,
1211
		  info  = strtoul (input_line_pointer,
1202
				  &input_line_pointer, 0);
1212
				   &input_line_pointer, 0);
1203
		  if (info == (unsigned int) -1)
1213
		  if (info == (unsigned int) -1)
1204
		    {
1214
		    {
1205
		      as_warn (_("unsupported mbind section info: %s"), t);
1215
		      as_warn (_("unsupported mbind section info: %s"), t);
Lines 1207-1212 obj_elf_section (int push) Link Here
1207
		    }
1217
		    }
1208
		}
1218
		}
1209
	    }
1219
	    }
1220
1221
	  if (*input_line_pointer == ',')
1222
	    {
1223
	      char *save = input_line_pointer;
1224
	      ++input_line_pointer;
1225
	      SKIP_WHITESPACE ();
1226
	      if (strncmp (input_line_pointer, "unique", 6) == 0)
1227
		{
1228
		  input_line_pointer += 6;
1229
		  SKIP_WHITESPACE ();
1230
		  if (*input_line_pointer == ',')
1231
		    {
1232
		      ++input_line_pointer;
1233
		      SKIP_WHITESPACE ();
1234
		      if (ISDIGIT (* input_line_pointer))
1235
			{
1236
			  unsigned int id;
1237
			  char *t = input_line_pointer;
1238
			  id = strtoul (input_line_pointer,
1239
					&input_line_pointer, 0);
1240
			  if (id == (unsigned int) -1)
1241
			    as_warn (_("unsupported section id: %s"), t);
1242
			  else
1243
			    section_id = id;
1244
			}
1245
		    }
1246
		}
1247
	      else
1248
		input_line_pointer = save;
1249
	    }
1210
	}
1250
	}
1211
      else
1251
      else
1212
	{
1252
	{
Lines 1238-1245 obj_elf_section (int push) Link Here
1238
done:
1278
done:
1239
  demand_empty_rest_of_line ();
1279
  demand_empty_rest_of_line ();
1240
1280
1241
  obj_elf_change_section (name, type, info, attr, entsize, group_name,
1281
  obj_elf_change_section (name, type, info, section_id, attr, entsize,
1242
			  linkonce, push);
1282
			  group_name, linkonce, push);
1243
1283
1244
  if ((gnu_attr & SHF_GNU_MBIND) != 0)
1284
  if ((gnu_attr & SHF_GNU_MBIND) != 0)
1245
    {
1285
    {
(-)a/gas/config/obj-elf.h (-3 / +2 lines)
Lines 162-169 extern void obj_elf_common (int); Link Here
162
extern void obj_elf_data (int);
162
extern void obj_elf_data (int);
163
extern void obj_elf_text (int);
163
extern void obj_elf_text (int);
164
extern void obj_elf_change_section
164
extern void obj_elf_change_section
165
  (const char *, unsigned int, unsigned int, bfd_vma, int, const char *,
165
  (const char *, unsigned int, unsigned int, unsigned int, bfd_vma, int,
166
   int, int);
166
   const char *, int, int);
167
extern void obj_elf_vtable_inherit (int);
167
extern void obj_elf_vtable_inherit (int);
168
extern void obj_elf_vtable_entry (int);
168
extern void obj_elf_vtable_entry (int);
169
extern struct fix * obj_elf_get_vtable_inherit (void);
169
extern struct fix * obj_elf_get_vtable_inherit (void);
170
- 

Return to bug 25380