/* This file is is generated by a shell script. DO NOT EDIT! */
/* 32 bit ELF emulation code for ${EMULATION_NAME}
- Copyright (C) 1991, 1993, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation, Inc.
Written by Steve Chamberlain <sac@cygnus.com>
ELF support by Ian Lance Taylor <ian@cygnus.com>
gld${EMULATION_NAME}_before_allocation ()
{
asection *sinterp;
+ lang_input_statement_type *is;
/* If we are going to make any variable assignments, we need to let
the ELF backend know about them in case the variables are
sinterp->contents = (bfd_byte *) command_line.interpreter;
sinterp->_raw_size = strlen (command_line.interpreter) + 1;
}
+
+ /* Look for any sections named .gnu.warning. As a GNU extensions,
+ we treat such sections as containing warning messages. We print
+ out the warning message, and then zero out the section size so
+ that it does not get copied into the output file. */
+
+ {
+ LANG_FOR_EACH_INPUT_STATEMENT (is)
+ {
+ asection *s;
+ bfd_size_type sz;
+ char *msg;
+ boolean ret;
+
+ if (is->just_syms_flag)
+ continue;
+
+ s = bfd_get_section_by_name (is->the_bfd, ".gnu.warning");
+ if (s == NULL)
+ continue;
+
+ sz = bfd_section_size (is->the_bfd, s);
+ msg = xmalloc ((size_t) sz + 1);
+ if (! bfd_get_section_contents (is->the_bfd, s, msg, (file_ptr) 0, sz))
+ einfo ("%F%B: Can't read contents of section .gnu.warning: %E\n",
+ is->the_bfd);
+ msg[sz] = '\0';
+ ret = link_info.callbacks->warning (&link_info, msg);
+ ASSERT (ret);
+ free (msg);
+
+ /* Clobber the section size, so that we don't waste copying the
+ warning into the output file. */
+ s->_raw_size = 0;
+ }
+ }
}
/* This is called by the before_allocation routine via
secname = bfd_get_section_name (s->owner, s);
+ /* When generating an object which is to be dynamically linked, we
+ do not support orphaned reloc sections. This is because all the
+ reloc sections must be contiguous in order to generate correct
+ DT_REL entries. When this case arises, you can just add the
+ appropriate reloc sections to the linker script. Note that the
+ .rel.plt section must always be the last reloc section. FIXME:
+ This should simply be handled correctly here. */
+ ASSERT (strncmp (secname, ".rel", 4) != 0
+ || bfd_get_section_by_name (output_bfd, ".dynamic") == NULL);
+
/* Create the section in the output file, and put it in the right
place. This shuffling to make the output file look neater, and
also means that the BFD backend does not have to sort the
syslib_default,
hll_default,
after_parse_default,
+ after_open_default,
after_allocation_default,
set_output_arch_default,
ldemul_default_target,