From: Kaz Kojima <kkojima@rr.iij4u.or.jp>
To: binutils@sources.redhat.com
Subject: [PATCH/RFC] Fix compile time warning when building ld
Date: Wed, 16 Feb 2005 11:54:00 -0000 [thread overview]
Message-ID: <20050216.132703.08319175.kkojima@rr.iij4u.or.jp> (raw)
Hi,
I've got a compile time warning when building ld with
--target=sh4-unknown-linux-gnu --with-sysroot=/foo --enable-build-warnings=-Werror,-Wall,-Wstrict-prototypes,-Wmissing-prototypes
eshlelf_linux.c: In function `gldshlelf_linux_after_open':
eshlelf_linux.c:768: warning: unused variable `lib_path'
make[3]: *** [eshlelf_linux.o] Error 1
on i686-linux. The variable lib_path is used only for NATIVE case
in gld${EMULATION_NAME}_after_open but defined for USE_LIBPATH case.
When --with-sysroot is used for cross building, only USE_LIBPATH is
yes and then we get the above warning.
The patch below is to fix this warning. Regtested with no regressions
both on i686-linux cross sh4-unknown-linux-gnu and native i686-linux.
Regards,
kaz
--
[ld/ChangeLog]
2005-02-16 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Define
lib_path if NATIVE is yes.
diff -uprN ORIG/src/ld/emultempl/elf32.em LOCAL/src/ld/emultempl/elf32.em
--- ORIG/src/ld/emultempl/elf32.em 2005-02-12 18:17:11.000000000 +0900
+++ LOCAL/src/ld/emultempl/elf32.em 2005-02-15 08:20:07.000000000 +0900
@@ -836,9 +836,13 @@ gld${EMULATION_NAME}_after_open (void)
size_t len;
search_dirs_type *search;
EOF
-if [ "x${USE_LIBPATH}" = xyes ] ; then
+if [ "x${NATIVE}" = xyes ] ; then
cat >>e${EMULATION_NAME}.c <<EOF
const char *lib_path;
+EOF
+fi
+if [ "x${USE_LIBPATH}" = xyes ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
struct bfd_link_needed_list *rp;
int found;
EOF
next reply other threads:[~2005-02-16 4:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-16 11:54 Kaz Kojima [this message]
2005-02-16 11:57 ` 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=20050216.132703.08319175.kkojima@rr.iij4u.or.jp \
--to=kkojima@rr.iij4u.or.jp \
--cc=binutils@sources.redhat.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).