This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

GAS overwrittes important bits when reading from symbol table


Hi Everyone,
      I am currently using binutils 2.11.93 for a proprietary processor.

Here is the line for the jump instruction:

{"jump",       "N",            "00 0x0 NNNNN NNNNN NNNN NNNN NNNN NPPP",

Where Jump is the name of the instruction, and N is the offset which is
computed by

Jump_Insn's address + signed value provided by the N value = New_Address to
Jump to.

PPP = Extra bits that are used by compiler to pass values.

Now, let's say we have this following code:

_start:   --
          --
          jump _main
          --
          --
          --
          --

_main:    --
	    --


The Assembler looks for the "_main" value in the symbol table (which
obviously doesn't exist when it is reading the jump instruction and then it
does a zero filling. Then right before writing the bits into the file, it
cross references with the symbol table and looks for the offset of "_main"
and puts them in the jump instruction (I think, NOT 100% sure!!).

The problem is that, it overwrites the "PPP" bits. How can I make it not do
this? Where exactly does this writing of the offset of main takes place?


Any help is highly appreciated.

Thanking You,

Yours Sincerely,

Balaji V. Iyer.

PS. Please CC me when responding since I am not a subscribed to this list.


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