This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


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

Re: linker script error compiling linux-host, i386-go32 target


'Covalent Bond' wrote:

> I am trying to create a cross-compiler hosted on linux, which 
> can compile programs for DOS.
> 
> I get a linker-script error in ld. 
> /home/jurriaan/cross/build/gcc/ld:built in linker script:24: parse error                                        
> 
> the linker-scripts in /home/jurriaan/cross/build/ld/ld-scripts:

 I'm a little late in this thread (cable failure yesterday...) but...

 Ok, the cure is old (from July -98?) :

------------- clip -----------------
# Linker script for i386 go32 (DJGPP)

test -z "$ENTRY" && ENTRY=start
EXE=${CONSTRUCTING+${RELOCATING+-exe}}

# These are substituted in as variables in order to get '}' in a shell
# conditional expansion.
CTOR='.ctor : { *(.ctor) }'
DTOR='.dtor : { *(.dtor) }'

cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}${EXE}")

ENTRY(${ENTRY})

SECTIONS
{
  .text ${RELOCATING+ ${TARGET_PAGE_SIZE}+SIZEOF_HEADERS} : {
    *(.text)
    *(.const*)
    *(.ro*)
    ${RELOCATING+etext  =  . ; _etext = .};
    ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});}
  }
  .data ${RELOCATING+ ${DATA_ALIGNMENT}} : {
    ${RELOCATING+djgpp_first_ctor = . ;
    *(.ctor)
    djgpp_last_ctor = . ;}
    ${RELOCATING+djgpp_first_dtor = . ;
    *(.dtor)
    djgpp_last_dtor = . ;}
    *(.data)
    ${RELOCATING+ edata  =  . ; _edata = .};
    ${RELOCATING+ . = ALIGN(${SEGMENT_SIZE});}
  }
  ${CONSTRUCTING+${RELOCATING-$CTOR}}
  ${CONSTRUCTING+${RELOCATING-$DTOR}}
  .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
  { 					
    *(.bss)
    *(COMMON)
    ${RELOCATING+ end = . ; _end = .};
    ${RELOCATING+ . = ALIGN(${SEGMENT_SIZE});}
  }
}
EOF
------------- clip -----------------

 Please substitute the 'i386go32.sc' linker script template in the 
binutils-2.9.1 'ld/scripttempl' with this, remake 'ld' and try again...

 This is a problem with some shells, not all, my Linux bash handled the
original template ok...

 Cheers, Kai
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.