Problem with GNU linker

Debabrata Sengupta debabrata@macmetit.com
Mon Apr 9 02:23:00 GMT 2001


Dear Sir/Madam,

We have written some code for SPARC processor. The program has three
modules. One module starts from 0x2000 location, other protion from
0x5000(trap routine) and third one from 0x8000. In a same program we
have three modules and the start of the modules have been defined by
.org 0x2000, 0x5000 and 0x8000 respectively. We assembled the program
with GNU assembler and from the list file (.lst file) we observed that
the code starts from location 0x2000, 0x5000 & 0x8000 respectively. Next
we do the linking using ld command. By disassembling the linked file
using "objdump" we find that the program starts from location 0x2020,
0x5020 and 0x8020 respectively. This is the case when when we have not
defined any starting address using -Ttext option. If we define starting
address at 0x2000 using -Ttext 0x2000, and if .orgs (.org defination)
are present, then the code starts from 0x4020, 0x7020 & 0xa020. It
appears that code doesnot starts from starting location but starts from
a location 32 bytes away from the starting loaction. Can you please give
me an idea of how to resolve the problem so that the program can start
from the defined location not from a location having 32 byte shift.

Thanks & regards,

Debabrata Sengupta



More information about the Gcc-help mailing list