This is the mail archive of the mailing list for the binutils 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: ELF options may be missing from `ld --help' output after migration to ld_list_options

On 15/4/10 4:54 PM, Alan Modra wrote:
> On Fri, Apr 10, 2015 at 11:05:45AM +0300, Ilya Malakhov wrote:
>>  One should probably check whether to set elf_list_options and others to TRUE
>> in `*)' case rather than in `*" e${i}.o "*)' one within ld/ in
>> master branch of binutils-gdb.git:
> Indeed.  Thanks!
> 	* Set elf_list_options etc. in proper case.
> 	* configure: Regenerate.

I have another case that needs fixing related to ld_list_options.

nios2-linux has an emulation named "nios2linux", and happens to not include
another extra emulation with a name matching *elf*.  This makes nios2-linux
left out of the ELF options printing targets, which is unintended.

The name of emulation didn't play this part when I created "nios2linux" from
"nios2elf", so this is a recent breakage (glibc configure failed for me too :P).

I can change the emulation name to something like "nios2elf_linux" if required,
but may I suggest that configuration uses emulparams/*.sh contents too?
The attached patch also enables the ELF options when "TEMPLATE_NAME=elf32" is
found inside the emulparams file as well. This should make things more robust.


2015-05-14  Chung-Lin Tang  <>

        * (AC_PROG_GREP): Check for grep program.
        Enable ELF option printing for emulations containing 'TEMPLATE_NAME=elf32'.
        * configure: Regenerate.

diff --git a/ld/ b/ld/
index e120a05..54bfb86 100644
--- a/ld/
+++ b/ld/
@@ -31,6 +31,7 @@ AM_MAINTAINER_MODE
@@ -324,8 +325,14 @@ do
 	  test -z "$result" && result=$targ_alias
 	  echo tdir_$i=$result >> tdirs
 	  case "${i}" in
-	  *elf*)
-	    elf_list_options=TRUE
+	  *elf*) elf_list_options=TRUE ;;
+	  *)
+	    if test `$GREP "TEMPLATE_NAME=elf32" ${srcdir}/emulparams/${i}.sh`; then
+	      elf_list_options=TRUE
+	    fi
+	    ;;
+	  esac
+	  if test "$elf_list_options" = "TRUE"; then
 	    . ${srcdir}/emulparams/${i}.sh
 	    if test x${GENERATE_SHLIB_SCRIPT} = xyes; then
@@ -333,8 +340,7 @@ do
 	    if test x${PLT_UNWIND} = xyes; then
-	    ;;
-	  esac
+	  fi	    

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