This is the mail archive of the binutils@sources.redhat.com 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]

Re: Adjusting value of _SDA_BASE_


>>>>> "Geoff" == Geoff Keating <geoffk@geoffk.org> writes:

>> From: Momchil Velikov <velco@fadata.bg>
>> Date: 19 Feb 2001 00:14:44 +0200
>> 
>> >>>>> "Geoff" == Geoff Keating <geoffk@geoffk.org> writes:
>> 
>> >> From: Momchil Velikov <velco@fadata.bg>
>> >> Date: 18 Feb 2001 19:49:11 +0200
>> 
>> >> This patch adjust the values of _SDA_BASE_ and _SDA2_BASE_ so the
>> >> symbols in small data sections are within range.
>> 
Geoff> Can you explain why this patch is needed?  _SDA_BASE_ is normally
Geoff> chosen to have the maximum possible range anyway.
>> 
>> _SDA_BASE_ is created at offset 32768 from the beginning of
>> the linker created `.sdata'. If this section is at `output_offset'
>> greater that zero the data items at the beginnig of the output
>> `.sdata' section become inaccessible.  

Geoff> Can you provide a testcase?
Sure.

In xx.c:
      int foo = 0;

In yy.c:
      extern int foo;

      int _start ()
      {
	return foo;
      }

Makefile:
      CC = powerpc-sysv4-gcc
      CFLAGS = -msdata

      zz: xx.o yy.o
      	owerpc-sysv4-ld -o $@ $^

      clean:
      	$(RM) xx.o yy.o zz

Regards,
-velco









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