1 2002-05-22 Richard Henderson <rth@redhat.com>
3 * varasm.c (default_section_type_flags): Handle tls data and
6 * gcc.dg/tls/section-1.c: New test.
8 2002-03-15 Jason Merrill <jason@redhat.com>
10 * varasm.c (assemble_variable): Call resolve_unique_section before
11 checking DECL_SECTION_NAME.
13 --- gcc/testsuite/gcc.dg/tls/section-1.c.jj 2002-08-08 16:11:55.000000000 +0200
14 +++ gcc/testsuite/gcc.dg/tls/section-1.c 2002-08-08 16:19:08.000000000 +0200
16 +/* Verify that we get errors for trying to put TLS data in
17 + sections which can't work. */
19 +#define A(X) __attribute__((section(X)))
21 +__thread int i A("foo"); /* Ok */
23 +__thread int j A(".data"); /* { dg-error "causes a section type conflict" "conflict with .data section" { xfail *-*-* } } */
26 +__thread int l A("bar"); /* { dg-error "causes a section type conflict" "conflict with user-defined section" } */
27 --- gcc/varasm.c.jj 2002-08-01 20:58:53.000000000 +0200
28 +++ gcc/varasm.c 2002-08-08 16:10:15.000000000 +0200
29 @@ -1599,6 +1599,13 @@
30 if (TREE_PUBLIC (decl))
31 maybe_assemble_visibility (decl);
33 + /* Output any data that we will need to use the address of. */
34 + if (DECL_INITIAL (decl) == error_mark_node)
35 + reloc = contains_pointers_p (TREE_TYPE (decl)) ? 3 : 0;
36 + else if (DECL_INITIAL (decl))
37 + reloc = output_addressed_constants (DECL_INITIAL (decl));
38 + resolve_unique_section (decl, reloc, flag_data_sections);
40 /* Handle uninitialized definitions. */
42 /* If the decl has been given an explicit section name, then it
43 @@ -1654,14 +1661,7 @@
44 if (TREE_PUBLIC (decl) && DECL_NAME (decl))
45 globalize_decl (decl);
47 - /* Output any data that we will need to use the address of. */
48 - if (DECL_INITIAL (decl) == error_mark_node)
49 - reloc = contains_pointers_p (TREE_TYPE (decl)) ? 3 : 0;
50 - else if (DECL_INITIAL (decl))
51 - reloc = output_addressed_constants (DECL_INITIAL (decl));
53 /* Switch to the appropriate section. */
54 - resolve_unique_section (decl, reloc, flag_data_sections);
55 variable_section (decl, reloc);
57 /* dbxout.c needs to know this. */
58 @@ -5345,11 +5345,14 @@
59 || strcmp (name, ".sbss") == 0
60 || strncmp (name, ".sbss.", 6) == 0
61 || strncmp (name, ".gnu.linkonce.sb.", 17) == 0
62 - || strcmp (name, ".tbss") == 0)
63 + || strcmp (name, ".tbss") == 0
64 + || strncmp (name, ".gnu.linkonce.tb.", 17) == 0)
67 if (strcmp (name, ".tdata") == 0
68 - || strcmp (name, ".tbss") == 0)
69 + || strcmp (name, ".tbss") == 0
70 + || strncmp (name, ".gnu.linkonce.td.", 17) == 0
71 + || strncmp (name, ".gnu.linkonce.tb.", 17) == 0)