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]

A warning issue for static link


Hi,all

I'm a newbie to GNU development environment.Now I have some questions for the GNU link tools based on my experiences.

I just built my project by using GNU 2.7.2-960126 tools in Solaris 2.8 environment.(C shell)

But when I linked the tow static libraries for one binary file,the warning emerged as following:
Warning: size of symbol `sleep__6ACE_OSUi' changed from 108 to 116 in web_ser.o.....

My partial makefile was written as following:

WEBSERV_LIBS = -lwebserv
SSF_LIBS = -lssf
static:
ld -o $(BIN_DIR)/$(BIN) -r -L $(WEBSERV_LIBS) $(SSF_LIBS)

Note: I have alread built the libwebserv.a and the libssf.a correctly by using "g++ -g -nostdinc -fvolatile -fno-builtin -fno-for-scope -fno-defer-pop " and ar tools.

The symbol "sleep__6ACE_OSUi" was defined in the libssf.a. I just used it in the" web_ser.cpp "which was built in libwebserv.a.

Now I want to know why this warning emerged? This means what about?

PS: I found the function" elf_link_add_object_symbols" in the GNU elflink.h file, there were some lines as following:

if (info->hash->creator->flavour == bfd_target_elf_flavour)
{
int old_flags;
boolean dynsym;
int new_flag;

/* Remember the symbol size and type. */
if (sym.st_size != 0
&& (definition || h->size == 0))
{
if (h->size != 0 && h->size != sym.st_size && ! size_change_ok)
(*_bfd_error_handler)
(_("Warning: size of symbol `%s' changed from %lu to %lu in %s"),
name, (unsigned long) h->size, (unsigned long) sym.st_size,
bfd_archive_filename (abfd));

h->size = sym.st_size;
}

/* If this is a common symbol, then we always want H->SIZE
to be the size of the common symbol. The code just above
won't fix the size if a common symbol becomes larger. We
don't warn about a size change here, because that is
covered by --warn-common. */
if (h->root.type == bfd_link_hash_common)
h->size = h->root.u.c.size;

if (ELF_ST_TYPE (sym.st_info) != STT_NOTYPE
&& (definition || h->type == STT_NOTYPE))
{
if (h->type != STT_NOTYPE
&& h->type != ELF_ST_TYPE (sym.st_info)
&& ! type_change_ok)
(*_bfd_error_handler)
(_("Warning: type of symbol `%s' changed from %d to %d in %s"),
name, h->type, ELF_ST_TYPE (sym.st_info),
bfd_archive_filename (abfd));

h->type = ELF_ST_TYPE (sym.st_info);
}
"

and the sym , size_change_ok return by this line :

if (! elf_merge_symbol (abfd, info, name, &sym, &sec, &value,
sym_hash, &override, &type_change_ok,
&size_change_ok, dt_needed))
goto error_return;

So, anybody can tell me why do it herein and what's wrong with my static link? 

Thanks in advance.


Best regards,

Eddie.


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