* symtab.cc (Symbol_table::sized_write_globals): Subtract
    	section starting address for relocatable link.
    	* testsuite/Makefile.am (script_test_11): New test.
    	* testsuite/Makefile.in: Regenerate.
    	* testsuite/script_test_11.c: New source file.
    	* testsuite/script_test_11.t: New linker script.
This commit is contained in:
Cary Coutant
2013-04-15 16:34:12 +00:00
parent 4d40cad203
commit 502e8a8430
6 changed files with 91 additions and 13 deletions

View File

@@ -0,0 +1,16 @@
static unsigned int buffer1[256] __attribute((used));
static unsigned int buffer2[256] __attribute((used)) = { 1 };
unsigned int foo __attribute__((section(".foo")));
extern char __foo_start;
extern char __foo_end;
int
main (void)
{
if (&__foo_end - &__foo_start != sizeof(foo))
return 1;
if (&__foo_start != (char *)&foo)
return 2;
return 0;
}