From: Mark Mitchell <mark@codesourcery.com>
To: Ian Lance Taylor <iant@google.com>, binutils@sourceware.org
Subject: Re: RFC: COMDAT group names become anonymouse local symbols
Date: Fri, 22 Oct 2010 15:34:00 -0000 [thread overview]
Message-ID: <4CC1AF10.3050900@codesourcery.com> (raw)
In-Reply-To: <20101022071548.GF26553@bubble.grove.modra.org>
[-- Attachment #1: Type: text/plain, Size: 482 bytes --]
On 10/22/2010 12:15 AM, Alan Modra wrote:
> grep obj_adjust_symtab says you have a tweak to make to config/tc-arm.c
> egrep '(group section|GROUP)' will hit a few more testcases in
> gas/testsuite/gas/ia64/, binutils/testsuite/binutils-all/, and
> ld/testsuite/ld-elf/
Good catches. I've now run the full testsuite on
x86_64-unknown-linux-gnu, arm-eabi, and ia64-elf. How about this version?
Thank you,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
[-- Attachment #2: gas.patch --]
[-- Type: text/plain, Size: 25711 bytes --]
2010-10-21 Mark Mitchell <mark@codesourcery.com>
* config/obj-elf.c (elf_adjust_symtab): New. Move group section
processing here from elf_frob_file. Ensure that group signature
symbols have the name of the group.
(elf_frob_file): Move group section processing to
elf_adjust_symtab.
* config/obj-elf.h (elf_adjust_symtab): Declare.
(obj_adjust_symtab): Define.
* config/tc-arm.c (arm_adjust_symtab): Call elf_adjust_symtab.
2010-10-22 Mark Mitchell <mark@codesourcery.com>
* binutils-all/group-5.d: Expect ".group" for the name of group
sections.
* binutils-all/strip-2.d: Likewise.
2010-10-21 Mark Mitchell <mark@codesourcery.com>
* gas/elf/elf.exp: Add group0c test.
* gas/elf/group0c.d: New.
* gas/elf/group0a.d: Expect ".group" for the name of group
sections.
* gas/elf/group0b.d: Likewise.
* gas/elf/group1a.d: Likewise.
* gas/elf/group1b.d: Likewise.
* gas/elf/groupautoa.d: Likewise.
* gas/elf/groupautob.d: Likewise.
* gas/elf/section4.d: Likewise.
* gas/ia64/group-1.d: Likewise. Adjust hard-coded constants.
2010-10-22 Mark Mitchell <mark@codesourcery.com>
* ld-elf/group10.d: Expect ".group" for the name of group
sections.
* ld-elf/group2.d: Likewise.
* ld-elf/group7.d: Likewise.
Index: gas/config/obj-elf.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.c,v
retrieving revision 1.131
diff -c -5 -p -r1.131 obj-elf.c
*** gas/config/obj-elf.c 16 Sep 2010 23:55:09 -0000 1.131
--- gas/config/obj-elf.c 22 Oct 2010 15:25:19 -0000
*************** static void free_section_idx (const char
*** 2079,2114 ****
{
free ((unsigned int *) val);
}
void
! elf_frob_file (void)
{
struct group_list list;
unsigned int i;
- bfd_map_over_sections (stdoutput, adjust_stab_sections, NULL);
-
/* Go find section groups. */
list.num_group = 0;
list.head = NULL;
list.elt_count = NULL;
! list.indexes = hash_new ();
bfd_map_over_sections (stdoutput, build_group_lists, &list);
!
/* Make the SHT_GROUP sections that describe each section group. We
can't set up the section contents here yet, because elf section
indices have yet to be calculated. elf.c:set_group_contents does
the rest of the work. */
! for (i = 0; i < list.num_group; i++)
{
const char *group_name = elf_group_name (list.head[i]);
const char *sec_name;
asection *s;
flagword flags;
struct symbol *sy;
- int has_sym;
bfd_size_type size;
flags = SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_GROUP;
for (s = list.head[i]; s != NULL; s = elf_next_in_group (s))
if ((s->flags ^ flags) & SEC_LINK_ONCE)
--- 2079,2111 ----
{
free ((unsigned int *) val);
}
void
! elf_adjust_symtab (void)
{
struct group_list list;
unsigned int i;
/* Go find section groups. */
list.num_group = 0;
list.head = NULL;
list.elt_count = NULL;
! list.indexes = hash_new ();
bfd_map_over_sections (stdoutput, build_group_lists, &list);
!
/* Make the SHT_GROUP sections that describe each section group. We
can't set up the section contents here yet, because elf section
indices have yet to be calculated. elf.c:set_group_contents does
the rest of the work. */
! for (i = 0; i < list.num_group; i++)
{
const char *group_name = elf_group_name (list.head[i]);
const char *sec_name;
asection *s;
flagword flags;
struct symbol *sy;
bfd_size_type size;
flags = SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_GROUP;
for (s = list.head[i]; s != NULL; s = elf_next_in_group (s))
if ((s->flags ^ flags) & SEC_LINK_ONCE)
*************** elf_frob_file (void)
*** 2120,2140 ****
group_name);
break;
}
}
! sec_name = group_name;
! sy = symbol_find_exact (group_name);
! has_sym = 0;
! if (sy != NULL
! && (sy == symbol_lastP
! || (sy->sy_next != NULL
! && sy->sy_next->sy_previous == sy)))
! {
! has_sym = 1;
! sec_name = ".group";
! }
s = subseg_force_new (sec_name, 0);
if (s == NULL
|| !bfd_set_section_flags (stdoutput, s, flags)
|| !bfd_set_section_alignment (stdoutput, s, 2))
{
--- 2117,2127 ----
group_name);
break;
}
}
! sec_name = ".group";
s = subseg_force_new (sec_name, 0);
if (s == NULL
|| !bfd_set_section_flags (stdoutput, s, flags)
|| !bfd_set_section_alignment (stdoutput, s, 2))
{
*************** elf_frob_file (void)
*** 2143,2171 ****
}
elf_section_type (s) = SHT_GROUP;
/* Pass a pointer to the first section in this group. */
elf_next_in_group (s) = list.head[i];
! if (has_sym)
! elf_group_id (s) = sy->bsym;
size = 4 * (list.elt_count[i] + 1);
bfd_set_section_size (stdoutput, s, size);
s->contents = (unsigned char *) frag_more (size);
frag_now->fr_fix = frag_now_fix_octets ();
frag_wane (frag_now);
}
- #ifdef elf_tc_final_processing
- elf_tc_final_processing ();
- #endif
-
/* Cleanup hash. */
hash_traverse (list.indexes, free_section_idx);
hash_die (list.indexes);
}
/* It removes any unneeded versioned symbols from the symbol table. */
void
elf_frob_file_before_adjust (void)
{
--- 2130,2176 ----
}
elf_section_type (s) = SHT_GROUP;
/* Pass a pointer to the first section in this group. */
elf_next_in_group (s) = list.head[i];
! /* Make sure that the signature symbol for the group has the
! name of the group. */
! sy = symbol_find_exact (group_name);
! if (!sy
! || (sy != symbol_lastP
! && (sy->sy_next == NULL
! || sy->sy_next->sy_previous != sy)))
! {
! /* Create the symbol now. */
! sy = symbol_new (group_name, now_seg, (valueT) 0, frag_now);
! symbol_get_obj (sy)->local = 1;
! symbol_table_insert (sy);
! }
! elf_group_id (s) = symbol_get_bfdsym (sy);
size = 4 * (list.elt_count[i] + 1);
bfd_set_section_size (stdoutput, s, size);
s->contents = (unsigned char *) frag_more (size);
frag_now->fr_fix = frag_now_fix_octets ();
frag_wane (frag_now);
}
/* Cleanup hash. */
hash_traverse (list.indexes, free_section_idx);
hash_die (list.indexes);
}
+ void
+ elf_frob_file (void)
+ {
+ bfd_map_over_sections (stdoutput, adjust_stab_sections, NULL);
+
+ #ifdef elf_tc_final_processing
+ elf_tc_final_processing ();
+ #endif
+ }
+
/* It removes any unneeded versioned symbols from the symbol table. */
void
elf_frob_file_before_adjust (void)
{
Index: gas/config/obj-elf.h
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.h,v
retrieving revision 1.37
diff -c -5 -p -r1.37 obj-elf.h
*** gas/config/obj-elf.h 13 Jan 2010 14:08:52 -0000 1.37
--- gas/config/obj-elf.h 22 Oct 2010 15:25:19 -0000
*************** void elf_copy_symbol_attributes (symbolS
*** 195,204 ****
--- 195,209 ----
#ifndef OBJ_COPY_SYMBOL_ATTRIBUTES
#define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \
(elf_copy_symbol_attributes (DEST, SRC))
#endif
+ void elf_adjust_symtab (void);
+ #ifndef obj_adjust_symtab
+ #define obj_adjust_symtab elf_adjust_symtab
+ #endif
+
#ifndef SEPARATE_STAB_SECTIONS
/* Avoid ifndef each separate macro setting by wrapping the whole of the
stab group on the assumption that whoever sets SEPARATE_STAB_SECTIONS
caters to ECOFF_DEBUGGING and the right setting of INIT_STAB_SECTIONS
and OBJ_PROCESS_STAB too, without needing the tweaks below. */
Index: gas/config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.470
diff -c -5 -p -r1.470 tc-arm.c
*** gas/config/tc-arm.c 6 Oct 2010 08:22:21 -0000 1.470
--- gas/config/tc-arm.c 22 Oct 2010 15:25:19 -0000
*************** arm_adjust_symtab (void)
*** 21955,21964 ****
--- 21955,21966 ----
}
}
/* Remove any overlapping mapping symbols generated by alignment frags. */
bfd_map_over_sections (stdoutput, check_mapping_symbols, (char *) 0);
+ /* Now do generic ELF adjustments. */
+ elf_adjust_symtab ();
#endif
}
/* MD interface: Initialization. */
Index: binutils/testsuite/binutils-all/group-5.d
===================================================================
RCS file: /cvs/src/src/binutils/testsuite/binutils-all/group-5.d,v
retrieving revision 1.1
diff -c -5 -p -r1.1 group-5.d
*** binutils/testsuite/binutils-all/group-5.d 18 Feb 2010 00:13:30 -0000 1.1
--- binutils/testsuite/binutils-all/group-5.d 22 Oct 2010 15:25:19 -0000
***************
*** 4,19 ****
#name: copy removing group member
#readelf: -Sg --wide
#...
! \[[ 0-9]+\] foo_group[ \t]+GROUP[ \t]+.*
#...
\[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t0-9a-f]+AXG.*
#...
\[[ 0-9]+\] \.data.*[ \t]+PROGBITS[ \t0-9a-f]+WAG.*
#...
! COMDAT group section \[[ 0-9]+\] `foo_group' \[foo_group\] contains 2 sections:
\[Index\] Name
\[[ 0-9]+\] .text.*
\[[ 0-9]+\] .data.*
#pass
--- 4,19 ----
#name: copy removing group member
#readelf: -Sg --wide
#...
! \[[ 0-9]+\] \.group[ \t]+GROUP[ \t]+.*
#...
\[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t0-9a-f]+AXG.*
#...
\[[ 0-9]+\] \.data.*[ \t]+PROGBITS[ \t0-9a-f]+WAG.*
#...
! COMDAT group section \[[ 0-9]+\] `\.group' \[foo_group\] contains 2 sections:
\[Index\] Name
\[[ 0-9]+\] .text.*
\[[ 0-9]+\] .data.*
#pass
Index: binutils/testsuite/binutils-all/strip-2.d
===================================================================
RCS file: /cvs/src/src/binutils/testsuite/binutils-all/strip-2.d,v
retrieving revision 1.1
diff -c -5 -p -r1.1 strip-2.d
*** binutils/testsuite/binutils-all/strip-2.d 14 Sep 2006 23:37:35 -0000 1.1
--- binutils/testsuite/binutils-all/strip-2.d 22 Oct 2010 15:25:19 -0000
***************
*** 3,18 ****
#strip: --strip-unneeded
#readelf: -Sg --wide
#name: strip with section group 2
#...
! \[[ 0-9]+\] foo_group[ \t]+GROUP[ \t]+.*
#...
\[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t0-9a-f]+AXG[ \t]+.*
#...
\[[ 0-9]+\] \.data.*[ \t]+PROGBITS[ \t0-9a-f]+WAG[ \t]+.*
#...
! COMDAT group section \[[ 0-9]+\] `foo_group' \[foo_group\] contains 2 sections:
\[Index\] Name
\[[ 0-9]+\] .text.*
\[[ 0-9]+\] .data.*
#pass
--- 3,18 ----
#strip: --strip-unneeded
#readelf: -Sg --wide
#name: strip with section group 2
#...
! \[[ 0-9]+\] \.group[ \t]+GROUP[ \t]+.*
#...
\[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t0-9a-f]+AXG[ \t]+.*
#...
\[[ 0-9]+\] \.data.*[ \t]+PROGBITS[ \t0-9a-f]+WAG[ \t]+.*
#...
! COMDAT group section \[[ 0-9]+\] `\.group' \[foo_group\] contains 2 sections:
\[Index\] Name
\[[ 0-9]+\] .text.*
\[[ 0-9]+\] .data.*
#pass
Index: gas/testsuite/gas/elf/elf.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/elf/elf.exp,v
retrieving revision 1.67
diff -c -5 -p -r1.67 elf.exp
*** gas/testsuite/gas/elf/elf.exp 20 Sep 2010 16:07:27 -0000 1.67
--- gas/testsuite/gas/elf/elf.exp 22 Oct 2010 15:25:20 -0000
*************** if { ([istarget "*-*-*elf*"]
*** 102,111 ****
--- 102,112 ----
run_dump_test "file"
}
}
run_dump_test "group0a"
run_dump_test "group0b"
+ run_dump_test "group0c"
run_dump_test "group1a"
run_dump_test "group1b"
run_dump_test "groupautoa"
run_dump_test "groupautob"
case $target_triplet in {
Index: gas/testsuite/gas/elf/group0a.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/elf/group0a.d,v
retrieving revision 1.2
diff -c -5 -p -r1.2 group0a.d
*** gas/testsuite/gas/elf/group0a.d 25 Nov 2004 00:56:00 -0000 1.2
--- gas/testsuite/gas/elf/group0a.d 22 Oct 2010 15:25:20 -0000
***************
*** 1,10 ****
#readelf: -SW
#name: group section
#source: group0.s
#...
! [ ]*\[.*\][ ]+\.foo_group[ ]+GROUP.*
#...
[ ]*\[.*\][ ]+\.foo[ ]+PROGBITS.*[ ]+AXG[ ]+.*
[ ]*\[.*\][ ]+\.bar[ ]+PROGBITS.*[ ]+AG[ ]+.*
#pass
--- 1,10 ----
#readelf: -SW
#name: group section
#source: group0.s
#...
! [ ]*\[.*\][ ]+\.group[ ]+GROUP.*
#...
[ ]*\[.*\][ ]+\.foo[ ]+PROGBITS.*[ ]+AXG[ ]+.*
[ ]*\[.*\][ ]+\.bar[ ]+PROGBITS.*[ ]+AG[ ]+.*
#pass
Index: gas/testsuite/gas/elf/group0b.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/elf/group0b.d,v
retrieving revision 1.2
diff -c -5 -p -r1.2 group0b.d
*** gas/testsuite/gas/elf/group0b.d 25 May 2005 06:30:25 -0000 1.2
--- gas/testsuite/gas/elf/group0b.d 22 Oct 2010 15:25:20 -0000
***************
*** 1,10 ****
#readelf: -g
#name: group section
#source: group0.s
#...
! COMDAT group section \[ 1\] `.foo_group' \[.foo_group\] contains 2 sections:
[ ]+\[Index\][ ]+Name
[ ]+\[.*\][ ]+.foo
[ ]+\[.*\][ ]+.bar
#pass
--- 1,10 ----
#readelf: -g
#name: group section
#source: group0.s
#...
! COMDAT group section \[ 1\] `\.group' \[.foo_group\] contains 2 sections:
[ ]+\[Index\][ ]+Name
[ ]+\[.*\][ ]+.foo
[ ]+\[.*\][ ]+.bar
#pass
Index: gas/testsuite/gas/elf/group0c.d
===================================================================
RCS file: gas/testsuite/gas/elf/group0c.d
diff -N gas/testsuite/gas/elf/group0c.d
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- gas/testsuite/gas/elf/group0c.d 22 Oct 2010 15:25:20 -0000
***************
*** 0 ****
--- 1,7 ----
+ #readelf: -sW
+ #name: group section name
+ #source: group0.s
+
+ #...
+ .*NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+[0-9]+[ ]+\.foo_group
+ #pass
Index: gas/testsuite/gas/elf/group1a.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/elf/group1a.d,v
retrieving revision 1.2
diff -c -5 -p -r1.2 group1a.d
*** gas/testsuite/gas/elf/group1a.d 25 Nov 2004 00:56:00 -0000 1.2
--- gas/testsuite/gas/elf/group1a.d 22 Oct 2010 15:25:20 -0000
***************
*** 1,11 ****
#readelf: -SW
#name: group section with multiple sections of same name
#source: group1.s
#...
! [ ]*\[.*\][ ]+\.foo_group[ ]+GROUP.*
#...
[ ]*\[.*\][ ]+\.text[ ]+PROGBITS.*[ ]+AX[ ]+.*
#...
[ ]*\[.*\][ ]+\.text[ ]+PROGBITS.*[ ]+AXG[ ]+.*
#pass
--- 1,11 ----
#readelf: -SW
#name: group section with multiple sections of same name
#source: group1.s
#...
! [ ]*\[.*\][ ]+\.group[ ]+GROUP.*
#...
[ ]*\[.*\][ ]+\.text[ ]+PROGBITS.*[ ]+AX[ ]+.*
#...
[ ]*\[.*\][ ]+\.text[ ]+PROGBITS.*[ ]+AXG[ ]+.*
#pass
Index: gas/testsuite/gas/elf/group1b.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/elf/group1b.d,v
retrieving revision 1.2
diff -c -5 -p -r1.2 group1b.d
*** gas/testsuite/gas/elf/group1b.d 25 May 2005 06:30:25 -0000 1.2
--- gas/testsuite/gas/elf/group1b.d 22 Oct 2010 15:25:20 -0000
***************
*** 1,9 ****
#readelf: -g
#name: group section with multiple sections of same name
#source: group1.s
#...
! COMDAT group section \[ 1\] `.foo_group' \[.foo_group\] contains 1 sections:
[ ]+\[Index\][ ]+Name
[ ]+\[.*\][ ]+.text
#pass
--- 1,9 ----
#readelf: -g
#name: group section with multiple sections of same name
#source: group1.s
#...
! COMDAT group section \[ 1\] `\.group' \[.foo_group\] contains 1 sections:
[ ]+\[Index\][ ]+Name
[ ]+\[.*\][ ]+.text
#pass
Index: gas/testsuite/gas/elf/groupautoa.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/elf/groupautoa.d,v
retrieving revision 1.1
diff -c -5 -p -r1.1 groupautoa.d
*** gas/testsuite/gas/elf/groupautoa.d 18 Aug 2010 00:43:46 -0000 1.1
--- gas/testsuite/gas/elf/groupautoa.d 22 Oct 2010 15:25:20 -0000
***************
*** 1,11 ****
#readelf: -SW
#name: automatic section group
#source: groupauto.s
#...
! [ ]*\[.*\][ ]+some_group[ ]+GROUP.*
#...
[ ]*\[.*\][ ]+\.text[ ]+PROGBITS.*[ ]+AX[ ]+.*
#...
[ ]*\[.*\][ ]+\.foo[ ]+PROGBITS.*[ ]+A[ ]+.*
#...
--- 1,11 ----
#readelf: -SW
#name: automatic section group
#source: groupauto.s
#...
! [ ]*\[.*\][ ]+\.group[ ]+GROUP.*
#...
[ ]*\[.*\][ ]+\.text[ ]+PROGBITS.*[ ]+AX[ ]+.*
#...
[ ]*\[.*\][ ]+\.foo[ ]+PROGBITS.*[ ]+A[ ]+.*
#...
Index: gas/testsuite/gas/elf/groupautob.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/elf/groupautob.d,v
retrieving revision 1.1
diff -c -5 -p -r1.1 groupautob.d
*** gas/testsuite/gas/elf/groupautob.d 18 Aug 2010 00:43:46 -0000 1.1
--- gas/testsuite/gas/elf/groupautob.d 22 Oct 2010 15:25:20 -0000
***************
*** 1,10 ****
#readelf: -g
#name: automatic section group
#source: groupauto.s
#...
! COMDAT group section \[ 1\] `some_group' \[some_group\] contains 2 sections:
[ ]+\[Index\][ ]+Name
[ ]+\[.*\][ ]+.text
[ ]+\[.*\][ ]+.note.bar
#pass
--- 1,10 ----
#readelf: -g
#name: automatic section group
#source: groupauto.s
#...
! COMDAT group section \[ 1\] `\.group' \[some_group\] contains 2 sections:
[ ]+\[Index\][ ]+Name
[ ]+\[.*\][ ]+.text
[ ]+\[.*\][ ]+.note.bar
#pass
Index: gas/testsuite/gas/elf/section4.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/elf/section4.d,v
retrieving revision 1.2
diff -c -5 -p -r1.2 section4.d
*** gas/testsuite/gas/elf/section4.d 25 Nov 2004 00:56:00 -0000 1.2
--- gas/testsuite/gas/elf/section4.d 22 Oct 2010 15:25:20 -0000
***************
*** 1,10 ****
#readelf: --sections
#name: label arithmetic with multiple same-name sections
#...
! [ ]*\[.*\][ ]+foo[ ]+GROUP.*
#...
[ ]*\[.*\][ ]+\.text[ ]+PROGBITS.*
#...
[ ]*\[.*\][ ]+\.data[ ]+PROGBITS.*
#...
--- 1,10 ----
#readelf: --sections
#name: label arithmetic with multiple same-name sections
#...
! [ ]*\[.*\][ ]+\.group[ ]+GROUP.*
#...
[ ]*\[.*\][ ]+\.text[ ]+PROGBITS.*
#...
[ ]*\[.*\][ ]+\.data[ ]+PROGBITS.*
#...
Index: gas/testsuite/gas/ia64/group-1.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/ia64/group-1.d,v
retrieving revision 1.5
diff -c -5 -p -r1.5 group-1.d
*** gas/testsuite/gas/ia64/group-1.d 19 Jul 2010 15:11:03 -0000 1.5
--- gas/testsuite/gas/ia64/group-1.d 22 Oct 2010 15:25:20 -0000
*************** There are 9 section headers, starting at
*** 6,32 ****
Section Headers:
\[Nr\] Name Type Address Offset
Size EntSize Flags Link Info Align
\[ 0\] NULL 0000000000000000 00000000
0000000000000000 0000000000000000 0 0 0
! \[ 1\] \._foo GROUP 0000000000000000 00000040
0000000000000008 0000000000000004 7 6 4
\[ 2\] \.text PROGBITS 0000000000000000 00000050
0000000000000000 0000000000000000 AX 0 0 16
\[ 3\] \.data PROGBITS 0000000000000000 00000050
0000000000000000 0000000000000000 WA 0 0 1
\[ 4\] \.bss NOBITS 0000000000000000 00000050
0000000000000000 0000000000000000 WA 0 0 1
\[ 5\] \.text PROGBITS 0000000000000000 00000050
0000000000000010 0000000000000000 AXG 0 0 16
\[ 6\] \.shstrtab STRTAB 0000000000000000 00000060
! 0000000000000032 0000000000000000 0 0 1
\[ 7\] \.symtab SYMTAB 0000000000000000 000002d8
! 00000000000000a8 0000000000000018 8 7 8
! \[ 8\] \.strtab STRTAB 0000000000000000 00000380
! 0000000000000006 0000000000000000 0 0 1
Key to Flags:
#...
! COMDAT group section \[ 1\] `\._foo' \[\._foo\] contains 1 sections:
\[Index\] Name
\[ 5\] \.text
--- 6,32 ----
Section Headers:
\[Nr\] Name Type Address Offset
Size EntSize Flags Link Info Align
\[ 0\] NULL 0000000000000000 00000000
0000000000000000 0000000000000000 0 0 0
! \[ 1\] \.group GROUP 0000000000000000 00000040
0000000000000008 0000000000000004 7 6 4
\[ 2\] \.text PROGBITS 0000000000000000 00000050
0000000000000000 0000000000000000 AX 0 0 16
\[ 3\] \.data PROGBITS 0000000000000000 00000050
0000000000000000 0000000000000000 WA 0 0 1
\[ 4\] \.bss NOBITS 0000000000000000 00000050
0000000000000000 0000000000000000 WA 0 0 1
\[ 5\] \.text PROGBITS 0000000000000000 00000050
0000000000000010 0000000000000000 AXG 0 0 16
\[ 6\] \.shstrtab STRTAB 0000000000000000 00000060
! 0000000000000033 0000000000000000 0 0 1
\[ 7\] \.symtab SYMTAB 0000000000000000 000002d8
! 00000000000000c0 0000000000000018 8 8 8
! \[ 8\] \.strtab STRTAB 0000000000000000 00000398
! 000000000000000c 0000000000000000 0 0 1
Key to Flags:
#...
! COMDAT group section \[ 1\] `\.group' \[\._foo\] contains 1 sections:
\[Index\] Name
\[ 5\] \.text
Index: ld/testsuite/ld-elf/group10.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elf/group10.d,v
retrieving revision 1.1
diff -c -5 -p -r1.1 group10.d
*** ld/testsuite/ld-elf/group10.d 19 Feb 2010 01:47:16 -0000 1.1
--- ld/testsuite/ld-elf/group10.d 22 Oct 2010 15:25:23 -0000
***************
*** 1,11 ****
#source: group10.s
#ld: -r -T group.ld
#readelf: -Sg --wide
#...
! group section \[[ 0-9]+\] `foo_group' \[foo_group\] contains 4 sections:
\[Index\] Name
\[[ 0-9]+\] \.text.*
\[[ 0-9]+\] \.rodata\.str.*
\[[ 0-9]+\] \.data.*
\[[ 0-9]+\] \.keepme.*
--- 1,11 ----
#source: group10.s
#ld: -r -T group.ld
#readelf: -Sg --wide
#...
! group section \[[ 0-9]+\] `\.group' \[foo_group\] contains 4 sections:
\[Index\] Name
\[[ 0-9]+\] \.text.*
\[[ 0-9]+\] \.rodata\.str.*
\[[ 0-9]+\] \.data.*
\[[ 0-9]+\] \.keepme.*
Index: ld/testsuite/ld-elf/group2.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elf/group2.d,v
retrieving revision 1.3
diff -c -5 -p -r1.3 group2.d
*** ld/testsuite/ld-elf/group2.d 23 Sep 2010 12:24:41 -0000 1.3
--- ld/testsuite/ld-elf/group2.d 22 Oct 2010 15:25:23 -0000
***************
*** 5,20 ****
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
# xstormy also uses a non-standard script, putting .data before .text.
#...
! \[[ 0-9]+\] foo_group[ \t]+GROUP[ \t]+.*
#...
\[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t0-9a-f]+AXG.*
#...
\[[ 0-9]+\] \.data.*[ \t]+PROGBITS[ \t0-9a-f]+WAG.*
#...
! COMDAT group section \[[ 0-9]+\] `foo_group' \[foo_group\] contains 2 sections:
\[Index\] Name
\[[ 0-9]+\] .text.*
\[[ 0-9]+\] .data.*
#pass
--- 5,20 ----
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
# xstormy also uses a non-standard script, putting .data before .text.
#...
! \[[ 0-9]+\] \.group[ \t]+GROUP[ \t]+.*
#...
\[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t0-9a-f]+AXG.*
#...
\[[ 0-9]+\] \.data.*[ \t]+PROGBITS[ \t0-9a-f]+WAG.*
#...
! COMDAT group section \[[ 0-9]+\] `\.group' \[foo_group\] contains 2 sections:
\[Index\] Name
\[[ 0-9]+\] .text.*
\[[ 0-9]+\] .data.*
#pass
Index: ld/testsuite/ld-elf/group7.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elf/group7.d,v
retrieving revision 1.2
diff -c -5 -p -r1.2 group7.d
*** ld/testsuite/ld-elf/group7.d 18 Sep 2010 02:30:41 -0000 1.2
--- ld/testsuite/ld-elf/group7.d 22 Oct 2010 15:25:23 -0000
***************
*** 7,17 ****
#xfail: cr16-*-* crx-*-*
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
#...
! COMDAT group section \[[ 0-9]+\] `foo_group' \[foo_group\] contains 2 sections:
\[Index\] Name
\[[ 0-9]+\] .text.foo
\[[ 0-9]+\] .data.foo
#...
COMDAT group section \[[ 0-9]+\] `.group' \[.text.foo\] contains 2 sections:
--- 7,17 ----
#xfail: cr16-*-* crx-*-*
# cr16 and crx use non-standard scripts with memory regions, which don't play
# well with unique group sections under ld -r.
#...
! COMDAT group section \[[ 0-9]+\] `\.group' \[foo_group\] contains 2 sections:
\[Index\] Name
\[[ 0-9]+\] .text.foo
\[[ 0-9]+\] .data.foo
#...
COMDAT group section \[[ 0-9]+\] `.group' \[.text.foo\] contains 2 sections:
next prev parent reply other threads:[~2010-10-22 15:34 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-19 20:08 Mark Mitchell
2010-10-20 18:05 ` Cary Coutant
2010-10-20 18:19 ` Mark Mitchell
2010-10-21 6:12 ` Cary Coutant
2010-10-21 0:18 ` Alan Modra
2010-10-21 0:31 ` Mark Mitchell
2010-10-21 1:04 ` Ian Lance Taylor
2010-10-21 4:41 ` Mark Mitchell
2010-10-21 5:19 ` H.J. Lu
2010-10-21 5:27 ` Mark Mitchell
2010-10-21 5:41 ` H.J. Lu
2010-10-21 5:42 ` Mark Mitchell
2010-10-21 6:24 ` Alan Modra
2010-10-21 16:41 ` Mark Mitchell
2010-10-21 18:50 ` Daniel Jacobowitz
2010-10-21 20:22 ` Mark Mitchell
2010-10-21 22:19 ` Alan Modra
2010-10-21 22:41 ` Mark Mitchell
2010-10-21 23:11 ` Alan Modra
2010-10-22 3:23 ` Mark Mitchell
2010-10-22 4:33 ` Alan Modra
2010-10-22 6:10 ` Mark Mitchell
2010-10-22 7:16 ` Alan Modra
2010-10-22 15:34 ` Mark Mitchell [this message]
2010-10-23 8:16 ` Alan Modra
2010-10-23 18:05 ` Mark Mitchell
2010-10-24 1:15 ` Hans-Peter Nilsson
2010-10-24 1:43 ` Mark Mitchell
2010-10-24 3:50 ` Hans-Peter Nilsson
2010-10-24 4:34 ` Mark Mitchell
2010-10-25 11:45 ` Hans-Peter Nilsson
2010-10-25 12:39 ` Alan Modra
2010-10-25 15:22 ` Mark Mitchell
2010-10-26 3:45 ` Alan Modra
2010-10-26 15:48 ` Dave Korn
2010-10-26 15:49 ` Mark Mitchell
2010-10-26 15:59 ` Dave Korn
2010-10-26 16:12 ` Dave Korn
2010-10-21 2:12 ` Alan Modra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CC1AF10.3050900@codesourcery.com \
--to=mark@codesourcery.com \
--cc=binutils@sourceware.org \
--cc=iant@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).