I've recently joined a team that has a somewhat recurrent problem with functions being linked to variables and variables being linked to functions. It appears that there is no information put into the assembly file to tell the assembler or linker that something belongs in the data section or the text section. All previous compilers I have used will explictly flag externs as code or data. Is there anything I can do (modifying specs, command parameters) to change this behaviour with the existing compiler? Thanks in advance, Andrew Cc's appreciated Test File --------------------------- extern int someexternint; extern void someexternfunc(); void nevercalled(void) { int i = someexternint; someexternfunc(); } --------------------------- Test file compiled with -S # GNU C cygnus-2.7.2-960126 # -fpeephole -ffunction-cse -fkeep-static-consts -fpcc-struct-return -fcommon # -fgnu-linker -mpowerpc -mnew-mnemonics .file "foo.c" gcc2_compiled.: .section ".text" .align 2 .globl nevercalled .type nevercalled,@function nevercalled: stwu 1,-24(1) mflr 0 stw 31,20(1) stw 0,28(1) mr 31,1 addis 9,0,someexternint@ha addi 11,9,someexternint@l lwz 0,0(11) stw 0,8(31) bl someexternfunc .L1: lwz 11,0(1) lwz 0,4(11) mtlr 0 lwz 31,-4(11) mr 1,11 blr .Lfe1: .size nevercalled,.Lfe1-nevercalled .ident "GCC: (GNU) cygnus-2.7.2-960126" ~ [andrewc_top]hprnljf:$$ccppc -v Reading specs from /sw/wind/host/parisc-hpux10/lib/gcc-lib/powerpc-wrs-vxworks/cygnus-2.7.2 -960126/specs gcc driver version cygnus-2.7.2-960126 egcs-971225 tornado 2.0 executing gcc version cygnus -2.7.2-960126 *asm: -u %(asm_cpu) %{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} %{mrelocatable} %{mrelocatable-lib} %{memb} %{msdata: -memb} %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} *asm_final: %{pipe:-} *cpp: %{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian) %(cpp_cpu) *cc1: %{G*} *cc1plus: *endfile: *link: *lib: *libgcc: *startfile: *switches_need_spaces: *signed_char: %{!fsigned-char:-D__CHAR_UNSIGNED__} *predefines: -D__IEEE_BIG_ENDIAN -D__embedded__ -Asystem(embedded) -Acpu(powerpc) -Amachine(powerpc) *cross_compile: 1 *multilib: . !msoft-float !mcpu=860 !mcpu=821 !mcpu=403;soft-float msoft-float;soft-float mcpu=860;soft-float mcpu=821;soft-float mcpu=403; *cpp_cpu: %{!mcpu*: %{mpower: %{!mpower2: -D_ARCH_PWR}} %{mpower2: -D_ARCH_PWR2} %{mpowerpc*: -D_ARCH_PPC} %{mno-power: %{!mpowerpc*: -D_ARCH_COM}} %{!mno-power: %{!mpower2: %(cpp_default)}}} %{mcpu=common: -D_ARCH_COM} %{mcpu=power: -D_ARCH_PWR} %{mcpu=power2: -D_ARCH_PWR2} %{mcpu=powerpc: -D_ARCH_PPC} %{mcpu=rios: -D_ARCH_PWR} %{mcpu=rios1: -D_ARCH_PWR} %{mcpu=rios2: -D_ARCH_PWR2} %{mcpu=rsc: -D_ARCH_PWR} %{mcpu=rsc1: -D_ARCH_PWR} %{mcpu=403: -D_ARCH_PPC} %{mcpu=505: -D_ARCH_PPC} %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} %{mcpu=602: -D_ARCH_PPC} %{mcpu=603: -D_ARCH_PPC} %{mcpu=603e: -D_ARCH_PPC} %{mcpu=604: -D_ARCH_PPC} %{mcpu=620: -D_ARCH_PPC} %{mcpu=821: -D_ARCH_PPC} %{mcpu=860: -D_ARCH_PPC} *cpp_default: -D_ARCH_PPC *cpp_sysv: %{mrelocatable: -D_RELOCATABLE} %{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} %{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} %{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: %(cpp_sysv_default) }}}} %{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT} %{mcpu=860: -D_SOFT_FLOAT} *cpp_sysv_default: -D_CALL_SYSV *cpp_endian: %{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} %{mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)} %{!mlittle: %{!mlittle-endian: -Amachine(bigendian)}} *asm_cpu: %{!mcpu*: %{mpower: %{!mpower2: -mpwr}} %{mpower2: -mpwrx} %{mpowerpc*: -mppc} %{mno-power: %{!mpowerpc*: -mcom}} %{!mno-power: %{!mpower2: %(asm_default)}}} %{mcpu=common: -mcom} %{mcpu=power: -mpwr} %{mcpu=power2: -mpwrx} %{mcpu=powerpc: -mppc} %{mcpu=rios: -mpwr} %{mcpu=rios1: -mpwr} %{mcpu=rios2: -mpwrx} %{mcpu=rsc: -mpwr} %{mcpu=rsc1: -mpwr} %{mcpu=403: -mppc} %{mcpu=505: -mppc} %{mcpu=601: -m601} %{mcpu=602: -mppc} %{mcpu=603: -mppc} %{mcpu=603e: -mppc} %{mcpu=604: -mppc} %{mcpu=620: -mppc} %{mcpu=821: -mppc} %{mcpu=860: -mppc} *asm_default: -mppc *link_syscalls: *link_libg: *link_path: *link_start: %{msim: %{!Ttext*: -Ttext 0x10000000}}