Bug 15178 - Target "elf32-sparc-freebsd" appears to be fiction.
Summary: Target "elf32-sparc-freebsd" appears to be fiction.
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.23
: P2 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-23 03:12 UTC by nwf
Modified: 2013-03-26 13:50 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nwf 2013-02-23 03:12:07 UTC
./gas/config/tc-sparc.h contains 

> #ifdef TE_FreeBSD
> #define ELF_TARGET_FORMAT       "elf32-sparc-freebsd"
> #define ELF64_TARGET_FORMAT     "elf64-sparc-freebsd"
> #endif

But this is the only mention of "elf32-sparc-freebsd" in the entire tree.  Whereas ./bfd/elf64-sparc.c contains special handling that defines "elf64-sparc-freebsd", there appears to be no similar handling in "bfd/elf32-sparc.c".

The net result is that invoking "as -32" yields

> Fatal error: selected target format 'elf32-sparc-freebsd' unknown

"objdump -H" lists many supported targets, but elf32-sparc-freebsd is not among them.

This is OK -- I do not think anybody seriously attempts to build 32-bit ELFs on FreeBSD on sparc (except by accident, as in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55308 which brought this to my attention), so I am not sure if the #define of "ELF_TARGET_FORMAT" should be removed or if the current behavior is intentional, in which case, can I please have a better error message?

Thanks!
--nwf;
Comment 1 Sourceware Commits 2013-03-26 13:49:14 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	nickc@sourceware.org	2013-03-26 13:49:12

Modified files:
	gas            : ChangeLog 
	gas/config     : tc-sparc.h 

Log message:
	PR gas/15178
	* config/tc-sparc.h (ELF_TARGET_FORMAT): Set to elf32-sparc for
	FreeBSD targets.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4955&r2=1.4956
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-sparc.h.diff?cvsroot=src&r1=1.31&r2=1.32
Comment 2 Nick Clifton 2013-03-26 13:50:45 UTC
Hi,

  Thanks for the bug report.  I have changed the 32bit ELF target for FreeBSD Sparc configurations of the assembler to be plain old "elf32-sparc", which I think resolves the problem.

Cheers
  Nick