aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog12
-rw-r--r--ld/emultempl/elf32.em9
-rw-r--r--ld/emultempl/hppaelf.em2
-rw-r--r--ld/scripttempl/elf.sc1
4 files changed, 22 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9e05021..2b470a1 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,15 @@
+2001-12-13 Jakub Jelinek <jakub@redhat.com>
+
+ * emultempl/elf32.em (finish): Supply output_bfd
+ to bfd_elf*_discard_info.
+ (OPTION_EH_FRAME_HDR): Define.
+ (longopts): Add --eh-frame-hdr.
+ (parse_args): Handle it.
+ (list_options): Add --eh-frame-hdr to help.
+ * emultempl/hppaelf.em (finish): Supply output_bfd
+ to bfd_elf*_discard_info.
+ * scripttempl/elf.sc (.eh_frame_hdr): Add.
+
2001-12-13 Alan Modra <amodra@bigpond.net.au>
* lexsup.c (parse_args): Don't pass shortopts to second call to
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 9974b24..ef71595 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1329,7 +1329,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
static void
gld${EMULATION_NAME}_finish ()
{
- if (bfd_elf${ELFSIZE}_discard_info (&link_info))
+ if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info))
{
/* Resize the sections. */
lang_size_sections (stat_ptr->head, abs_output_section,
@@ -1431,6 +1431,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
#define OPTION_DISABLE_NEW_DTAGS (400)
#define OPTION_ENABLE_NEW_DTAGS (OPTION_DISABLE_NEW_DTAGS + 1)
#define OPTION_GROUP (OPTION_ENABLE_NEW_DTAGS + 1)
+#define OPTION_EH_FRAME_HDR (OPTION_GROUP + 1)
static struct option longopts[] =
{
@@ -1444,6 +1445,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
{"disable-new-dtags", no_argument, NULL, OPTION_DISABLE_NEW_DTAGS},
{"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS},
{"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS},
+ {"eh-frame-hdr", no_argument, NULL, OPTION_EH_FRAME_HDR},
{"Bgroup", no_argument, NULL, OPTION_GROUP},
{"Bgroup", no_argument, NULL, OPTION_GROUP},
EOF
@@ -1504,6 +1506,10 @@ cat >>e${EMULATION_NAME}.c <<EOF
link_info.new_dtags = true;
break;
+ case OPTION_EH_FRAME_HDR:
+ link_info.eh_frame_hdr = true;
+ break;
+
case OPTION_GROUP:
link_info.flags_1 |= (bfd_vma) DF_1_GROUP;
/* Groups must be self-contained. */
@@ -1579,6 +1585,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
fprintf (file, _(" -Bgroup\t\tSelects group name lookup rules for DSO\n"));
fprintf (file, _(" --disable-new-dtags\tDisable new dynamic tags\n"));
fprintf (file, _(" --enable-new-dtags\tEnable new dynamic tags\n"));
+ fprintf (file, _(" --eh-frame-hdr\tCreate .eh_frame_hdr section\n"));
fprintf (file, _(" -z combreloc\t\tMerge dynamic relocs into one section and sort\n"));
fprintf (file, _(" -z defs\t\tDisallows undefined symbols\n"));
fprintf (file, _(" -z initfirst\t\tMark DSO to be initialized first at runtime\n"));
diff --git a/ld/emultempl/hppaelf.em b/ld/emultempl/hppaelf.em
index c8bd188..0b49b63 100644
--- a/ld/emultempl/hppaelf.em
+++ b/ld/emultempl/hppaelf.em
@@ -254,7 +254,7 @@ gld${EMULATION_NAME}_finish ()
ie. doesn't affect any code, so we can delay resizing the
sections. It's likely we'll resize everything in the process of
adding stubs. */
- if (bfd_elf${ELFSIZE}_discard_info (&link_info))
+ if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info))
need_laying_out = 1;
/* Call into the BFD backend to do the real work. */
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index bba7074..fe8e242 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -265,6 +265,7 @@ cat <<EOF
${CREATE_SHLIB-${SDATA2}}
${CREATE_SHLIB-${SBSS2}}
${OTHER_READONLY_SECTIONS}
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */