This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Help with an Wierd Error


On 04/02/2010 11:02 AM, Balaji.Iyer@gtri.gatech.edu wrote:
/opt/or32/lib/gcc/or32-elf/4.2.2/../../../../or32-elf/lib/crt0.o: In function `loop':
(.text+0x64): undefined reference to `___bss_start'

It looks like a case of one-too-many underscores prepended to symbol names. The default for ELF is to not prepend an underscore. The default for COFF is to prepend an underscore. Check USER_LABEL_PREFIX which should be empty for ELF (default definition in defaults.h file). Check ASM_OUTPUT_LABELREF which should use %U and not an explicit underscore (see defaults.h file). Check for usage of the -fleading-underscores option (should not be used). Check for header file inclusion to see if something is out of place, such as a use of svr3.h when svr4.h should be used.


Also check to make sure that gcc, gas, and gld all agree on whether a symbol is prepended with an underscore or not. If gcc does it but gas doesn't, then C code calling assembly language code may fail because of the mismatch.

Jim


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