This is the mail archive of the
mailing list for the binutils project.
Wrong jump/branch-offsets with assembler startup
- From: Jens Mehler <jens dot mehler at mni dot thm dot de>
- To: binutils at sourceware dot org
- Date: Fri, 15 Mar 2013 18:50:25 +0100
- Subject: Wrong jump/branch-offsets with assembler startup
I am porting the Gnu Binutils and I managed to handle most of the stuff.
During testing I discovered the following problem:
Whenever I try assemble with two files let's call them start.s (that
handles setting the stack poiner and jumping to main) and hello.s (that
contains code to emit a string) the jump/branch offsets are off by one.
This is not the case for jumping to main, it is however everywhere
starting from main i.e. in main in a jump to foo this jump is off by one
(negative one) while the offset from start to main is spot on.
The problem vanishes when I put the stuff from start.s into hello.s
Could someone please give me a pointer on how to solve this problem?
Many thanks in advance