This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [BZ#14767] Remove tests for have-initfini-array in elf/Makefile


On 10/27/2012 04:34 PM, Andreas Schwab wrote:
> Andreas Jaeger <aj@suse.com> writes:
> 
>> With the patch, the testsuite now fails:
>> tst-array1.c:89:14: error: fini_array causes a section type conflict
>> tst-array1.c:63:14: error: init_array causes a section type conflict
>> make[2]: *** [/home/aj/build/glibc/testing/elf/tst-array1.o] Error 1
>>
>> Any hints on what goes wrong here?
> 
> .fini_array and .init_array must be writable.

Thanks.

With the appended patch the test passes. Ok to commit?

There're some more tests to fix - but first I wanted to know whether
this is the right way,

Andreas

2012-10-27  Andreas Jaeger  <aj@suse.de>

	* elf/tst-array1.c (fini_array): Mark used so that GCC does not
	optimize it away, remove const.
	(init_array): Likewise.

diff --git a/elf/tst-array1.c b/elf/tst-array1.c
index 4d78db6..3e39622 100644
--- a/elf/tst-array1.c
+++ b/elf/tst-array1.c
@@ -60,8 +60,8 @@ init_2 (void)
   write (STDOUT_FILENO, "init array 2\n", 13);
 }
 
-void (*const init_array []) (void)
-     __attribute__ ((section (".init_array"), aligned (sizeof (void *)))) =
+void (*init_array []) (void)
+  __attribute__ ((used, section (".init_array"), aligned (sizeof (void *)))) =
 {
   &init_0,
   &init_1,
@@ -86,8 +86,8 @@ fini_2 (void)
   write (STDOUT_FILENO, "fini array 2\n", 13);
 }
 
-void (*const fini_array []) (void)
-     __attribute__ ((section (".fini_array"), aligned (sizeof (void *)))) =
+void (*fini_array []) (void)
+  __attribute__ ((used, section (".fini_array"), aligned (sizeof (void *)))) =
 {
   &fini_0,
   &fini_1,

-- 
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]