From: Kaz Kojima <kkojima@rr.iij4u.or.jp>
To: libc-hacker@sources.redhat.com
Cc: thomas@codesourcery.com
Subject: [PATCH] SH: Update sysdeps/sh/elf/initfini.c
Date: Tue, 08 Dec 2009 23:08:00 -0000 [thread overview]
Message-ID: <20091209.080805.16209967.kkojima@rr.iij4u.or.jp> (raw)
Hi,
The attached patch updates the SH specific initfini.c so to match
the current generic/initfini.c. sh/elf/initfini.c was made by
hand with modifying the assembler output for generic/initfini.c
to avoid wrongly placed constant pools. I've missed to update it
and that causes a problem pointed out in the thread
http://sourceware.org/ml/libc-alpha/2009-12/msg00000.html
Regards,
kaz
--
2009-12-08 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/sh/elf/initfini.c: Update according to generic/initfini.c.
--- ORIG/libc/sysdeps/sh/elf/initfini.c 2009-05-21 09:56:10.000000000 +0900
+++ libc/sysdeps/sh/elf/initfini.c 2009-12-08 08:35:36.000000000 +0900
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for SH.
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -47,52 +47,48 @@
__asm__ ("\
\n\
#include \"defs.h\"\n\
-#define SHARED\n\
\n\
/*@HEADER_ENDS*/\n\
\n\
/*@TESTS_BEGIN*/\n\
-\n\
+ .align 5\n\
/*@TESTS_END*/\n\
\n\
/*@_init_PROLOG_BEGINS*/\n\
- .section .init\n\
+ .section .init,\"ax\",@progbits\n\
.align 5\n\
.global _init\n\
- .type _init,@function\n\
+ .type _init, @function\n\
_init:\n\
mov.l r12,@-r15\n\
+ mova .L12,r0\n\
+ mov.l .L12,r12\n\
mov.l r14,@-r15\n\
- sts.l pr,@-r15\n\
-#ifdef SHARED\n\
- mova .L22,r0\n\
- mov.l .L22,r12\n\
add r0,r12\n\
- mova .L23,r0\n\
- mov.l .L23,r1\n\
- add r0,r1\n\
-#else\n\
- mov.l .L23,r1\n\
-#endif\n\
- jsr @r1\n\
- mov r15,r14\n\
+ mov.l .L13,r0\n\
+ sts.l pr,@-r15\n\
+ mov.l @(r0,r12),r1\n\
+ tst r1,r1\n\
+ bt/s .L8\n\
+ mov r15,r14\n\
+ mov.l .L14,r1\n\
+ bsrf r1\n\
+.LPCS0:\n\
+ nop\n\
+.L8:\n\
bra 1f\n\
- nop\n\
+ nop\n\
.align 2\n\
-#ifdef SHARED\n\
-.L22:\n\
+.L12:\n\
.long _GLOBAL_OFFSET_TABLE_\n\
-.L23:\n\
- .long __gmon_start__@PLT\n\
-#else\n\
-.L23:\n\
- .long __gmon_start__\n\
-#endif\n\
+.L13:\n\
+ .long __gmon_start__@GOT\n\
+.L14:\n\
+ .long __gmon_start__@PLT-(.LPCS0+2-(.))\n\
1:\n\
ALIGN\n\
END_INIT\n\
\n\
- \n\
/*@_init_PROLOG_ENDS*/\n\
\n\
/*@_init_EPILOG_BEGINS*/\n\
@@ -100,60 +96,58 @@ _init:\n\
mov r14,r15\n\
lds.l @r15+,pr\n\
mov.l @r15+,r14\n\
- rts \n\
mov.l @r15+,r12\n\
- END_INIT\n\
- .section .text\n\
- .align 5\n\
- .weak __gmon_start__\n\
- .type __gmon_start__,@function\n\
-__gmon_start__:\n\
- mov.l r14,@-r15\n\
- mov r15,r14\n\
- mov r14,r15\n\
rts \n\
- mov.l @r15+,r14\n\
- \n\
+ nop\n\
+ END_INIT\n\
+\n\
/*@_init_EPILOG_ENDS*/\n\
\n\
/*@_fini_PROLOG_BEGINS*/\n\
- .section .fini\n\
+ .section .fini,\"ax\",@progbits\n\
.align 5\n\
.global _fini\n\
- .type _fini,@function\n\
+ .type _fini, @function\n\
_fini:\n\
mov.l r12,@-r15\n\
+ mova .L19,r0\n\
mov.l r14,@-r15\n\
sts.l pr,@-r15\n\
-#ifdef SHARED\n\
- mova .L27,r0\n\
- mov.l .L27,r12\n\
- add r0,r12\n\
-#endif\n\
+ mov.l .L19,r12\n\
mov r15,r14\n\
+ add r0,r12\n\
+ bra 0f\n\
+ nop\n\
+ .align 2\n\
+.L19:\n\
+ .long _GLOBAL_OFFSET_TABLE_\n\
+0:\n\
ALIGN\n\
END_FINI\n\
-#ifdef SHARED\n\
+\n\
+/*@_fini_PROLOG_ENDS*/\n\
+ mov.l .L20,r1\n\
+ bsrf r1\n\
+.LPCS1:\n\
+ nop\n\
bra 1f\n\
- nop\n\
- .align 2\n\
-.L27:\n\
- .long _GLOBAL_OFFSET_TABLE_\n\
-#endif\n\
+ nop\n\
+ .align 2\n\
+.L20:\n\
+ .long i_am_not_a_leaf@PLT-(.LPCS1+2-(.))\n\
1:\n\
-/*@_fini_PROLOG_ENDS*/\n\
-\n\
/*@_fini_EPILOG_BEGINS*/\n\
.section .fini\n\
mov r14,r15\n\
lds.l @r15+,pr\n\
mov.l @r15+,r14\n\
- rts \n\
mov.l @r15+,r12\n\
-\n\
+ rts \n\
+ nop\n\
END_FINI\n\
- \n\
+\n\
/*@_fini_EPILOG_ENDS*/\n\
\n\
-/*@TRAILER_BEGINS*/\
+/*@TRAILER_BEGINS*/\n\
+ .weak __gmon_start__\n\
");
reply other threads:[~2009-12-08 23:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20091209.080805.16209967.kkojima@rr.iij4u.or.jp \
--to=kkojima@rr.iij4u.or.jp \
--cc=libc-hacker@sources.redhat.com \
--cc=thomas@codesourcery.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).