Bug 19327

Summary: Fix to build 'a.out' binary.
Product: Base System Reporter: yakisoba <yakisoba>
Component: gnuAssignee: Ceri Davies <ceri>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description yakisoba 2000-06-16 04:40:00 UTC
  After the base compiler is upgraded to GCC 2.95.2, 'a.out' binary
could not build.
  CURRENT and 4.0-STABLE GCC Target Macro still support both 'ELF'
and 'a.out'. So this problem is bug ? Or switch to 'ELF' only soon ?

If fix now, correct '__main.o' in libgcc.a like below.
     
    a.out __main.o:                     ELF  __main.o:
                   U ___CTOR_LIST__
                   U ___DTOR_LIST__
          00000028 T ___do_global_ctors
          00000000 T ___do_global_dtors
          0000007c T ___main
                   U __exit_dummy_decl
          000000a4 D __exit_dummy_ref
                   U _atexit

P.S. Now 'ELF' has garbege.

    ELF   __main.o:
                   U __do_global_ctors
          00000000 T __main

Fix: 1. Delete define 'INVOKE__main' in GCC Target Macro 'i386/freebsd.h'.

  2. Add the next line to GCC Target Macro 'i386/freebsd.h'.

     #if defined (IN_LIBGCC2) && !defined (__ELF__)
     #undef OBJECT_FORMAT_ELF
     #undef INIT_SECTION_ASM_OP
     #endif

  3. Add CFLAGS to 'gnu/lib/libgcc/Makefile'.

     CFLAGS+=   -DIN_LIBGCC2

  4. Improve 'function.c' hack.
Comment 1 Johan Karlsson freebsd_committer freebsd_triage 2000-10-12 20:48:24 UTC
Responsible Changed
From-To: freebsd-bugs->obrien

Over to GCC maintainer.
Comment 2 David E. O'Brien freebsd_committer freebsd_triage 2001-09-10 17:29:48 UTC
Responsible Changed
From-To: obrien->freebsd-bugs
Comment 3 iedowse freebsd_committer freebsd_triage 2002-08-10 00:24:48 UTC
State Changed
From-To: open->feedback


Does this problem still exist? Is it useful to keep this PR open 
now that a significant amount of time has elapsed since FreeBSD 
switched to using ELF?
Comment 4 Ceri Davies freebsd_committer freebsd_triage 2003-06-08 19:00:55 UTC
State Changed
From-To: feedback->closed

Feedback timeout (6 months or more). 
I will handle any feedback that this closure generates. 


Comment 5 Ceri Davies freebsd_committer freebsd_triage 2003-06-08 19:00:55 UTC
Responsible Changed
From-To: freebsd-bugs->ceri

Feedback timeout (6 months or more). 
I will handle any feedback that this closure generates.