bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/14322] New: Linker fails to properly handle __start_SECNAME symb


From: hjl.tools at gmail dot com
Subject: [Bug ld/14322] New: Linker fails to properly handle __start_SECNAME symbol
Date: Mon, 02 Jul 2012 18:29:16 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=14322

             Bug #: 14322
           Summary: Linker fails to properly handle __start_SECNAME symbol
           Product: binutils
           Version: 2.23 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


address@hidden xxx]$ cat x.c
#include <stdio.h>

extern char *bar ();
extern char __start__data_foo;

int
main ()
{
  char *p = bar ();
  printf ("%p: %p\n", &__start__data_foo, p);
  return 0;
}
address@hidden xxx]$ cat foo.c
#include <stdio.h>

#if 1
int foo __attribute__ ((section ("_data_foo"))) = 0;
extern char __start__data_foo;
#else
char __start__data_foo = 30;
#endif

char *
bar ()
{
  char *p = &__start__data_foo;
  printf ("%p: %p\n", &__start__data_foo, p);
  return p;
}
address@hidden xxx]$ make
gcc -B./     -c -o x.o x.c
gcc -B./  -fPIC   -c -o foo.o foo.c
gcc -B./  -shared -o libfoo.so foo.o
gcc -B./  -o x x.o libfoo.so -Wl,-rpath,.
./ld: warning: type and size of dynamic symbol `__start__data_foo' are not
defined
./x
0x7ffff7ffc9e0: 0x7ffff7ffc9e0
(nil): 0x7ffff7ffc9e0
address@hidden xxx]$ 

GCC should generate ".type __start__data_foo,%object" even if
__start__data_foo is undefined and linker should handle it more
gracefully.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]