A bug in 2.9.1 SH linker

Hao Zhou hzhou@qnx.com
Mon Jan 4 15:54:00 GMT 1999

Hi there,

I found a bug in gcc linker for Hitachi SH4 of release 2.9.1:

When object files are linked to an relocateable executable file,
and then the relocateable is linked to a fix-address executable, the
address of calls to local functions (in the same module) are wrong.
They are called to wrong places. 

However, if object files are linked directly to a fix-address
excutable file, there is no problem.

An example are attached with one makefile, two C files and a link
script file.
When the example is maked, two final executables are generated --
"wrong" and "right". "right" is generated directly from object files;
"wrong" is generated from a relocateable "mid", and "mid" is
generated by link the object files relocateably.
When the file "wrong" is examined by "objdump", we could see that two
calls in function "main" (to local funcations in the module main.c)
are wrong(calling into wrong address).

Quick fixes will be greatly appreciated as we are blocked by this

Thanks and regards,

More information about the Gcc-bugs mailing list