aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-01-24 16:01:04 +0000
committerIan Lance Taylor <ian@airs.com>1995-01-24 16:01:04 +0000
commit5f3548d6c755c7ddda69071cc80aa9f1f905ea24 (patch)
tree7107de3eefc7d18721f5fde2ce3aaebb1f919f21 /ld/emultempl
parent6ade1673fc14a4532c49c747884826c37f6b3663 (diff)
downloadgdb-5f3548d6c755c7ddda69071cc80aa9f1f905ea24.zip
gdb-5f3548d6c755c7ddda69071cc80aa9f1f905ea24.tar.gz
gdb-5f3548d6c755c7ddda69071cc80aa9f1f905ea24.tar.bz2
update copyrights
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/elf32.em50
1 files changed, 49 insertions, 1 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index a5f6ec5..43c2cc4 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c <<EOF
/* 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>
@@ -114,6 +114,7 @@ static void
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
@@ -137,6 +138,42 @@ gld${EMULATION_NAME}_before_allocation ()
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
@@ -246,6 +283,16 @@ gld${EMULATION_NAME}_place_orphan (file, s)
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
@@ -405,6 +452,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
syslib_default,
hll_default,
after_parse_default,
+ after_open_default,
after_allocation_default,
set_output_arch_default,
ldemul_default_target,