aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2008-10-20 12:14:29 +0000
committerAlan Modra <amodra@gmail.com>2008-10-20 12:14:29 +0000
commitc2edb4b89e374c7bca0c929dbab444928520a182 (patch)
tree68b715d8e99733a237dbb558b68c9a362dced8fe /ld
parent7d9616d7565ebf44ce849f24f42fd11f7f0b10f7 (diff)
downloadgdb-c2edb4b89e374c7bca0c929dbab444928520a182.zip
gdb-c2edb4b89e374c7bca0c929dbab444928520a182.tar.gz
gdb-c2edb4b89e374c7bca0c929dbab444928520a182.tar.bz2
* ldemul.h (ldemul_place_orphan): Update prototype.
(struct ld_emulation_xfer_struct <place_orphan>): Likewise. * ldemul.c (ldemul_place_orphan): Return pointer to output section statement. * emultempl/beos.em (gld${EMULATION_NAME}_place_orphan): Likewise. * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Likewise. * emultempl/mmo.em (mmo_place_orphan): Likewise. * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise. * emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog12
-rw-r--r--ld/emultempl/beos.em10
-rw-r--r--ld/emultempl/elf32.em16
-rw-r--r--ld/emultempl/mmo.em10
-rw-r--r--ld/emultempl/pe.em4
-rw-r--r--ld/emultempl/pep.em4
-rw-r--r--ld/ldemul.c4
-rw-r--r--ld/ldemul.h4
8 files changed, 37 insertions, 27 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index b46462f..6a0bb81 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,15 @@
+2008-10-20 Alan Modra <amodra@bigpond.net.au>
+
+ * ldemul.h (ldemul_place_orphan): Update prototype.
+ (struct ld_emulation_xfer_struct <place_orphan>): Likewise.
+ * ldemul.c (ldemul_place_orphan): Return pointer to output
+ section statement.
+ * emultempl/beos.em (gld${EMULATION_NAME}_place_orphan): Likewise.
+ * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Likewise.
+ * emultempl/mmo.em (mmo_place_orphan): Likewise.
+ * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
+ * emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
+
2008-10-08 Nick Clifton <nickc@redhat.com>
* configure.in (ALL_LINGUAS): Add "id".
diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em
index 2777be8..e417693 100644
--- a/ld/emultempl/beos.em
+++ b/ld/emultempl/beos.em
@@ -664,7 +664,7 @@ gld_${EMULATION_NAME}_before_allocation (void)
but I'm leaving this here in case we want to enable it for sections
which are not mentioned in the linker script. */
-static bfd_boolean
+static lang_output_section_statement_type *
gld${EMULATION_NAME}_place_orphan (asection *s,
const char *secname,
int constraint)
@@ -674,21 +674,21 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
lang_statement_union_type *l;
if ((s->flags & SEC_ALLOC) == 0)
- return FALSE;
+ return NULL;
/* Don't process grouped sections unless doing a final link.
If they're marked as COMDAT sections, we don't want .text\$foo to
end up in .text and then have .text disappear because it's marked
link-once-discard. */
if (link_info.relocatable)
- return FALSE;
+ return NULL;
/* Everything from the '\$' on gets deleted so don't allow '\$' as the
first character. */
if (*secname == '\$')
einfo ("%P%F: section %s has '\$' as first character\n", secname);
if (strchr (secname + 1, '\$') == NULL)
- return FALSE;
+ return NULL;
/* Look up the output section. The Microsoft specs say sections names in
image files never contain a '\$'. Fortunately, lang_..._lookup creates
@@ -726,7 +726,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
sort_sections. */
lang_add_section (&l->wild_statement.children, s, os);
- return TRUE;
+ return os;
}
static char *
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 7eb4e28..e1e7420 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -62,7 +62,7 @@ fragment <<EOF
static void gld${EMULATION_NAME}_before_parse (void);
static void gld${EMULATION_NAME}_after_open (void);
static void gld${EMULATION_NAME}_before_allocation (void);
-static bfd_boolean gld${EMULATION_NAME}_place_orphan
+static lang_output_section_statement_type *gld${EMULATION_NAME}_place_orphan
(asection *, const char *, int);
static void gld${EMULATION_NAME}_finish (void);
@@ -1635,7 +1635,7 @@ output_rel_find (asection *sec, int isdyn)
/* Place an orphan section. We use this to put random SHF_ALLOC
sections in the right segment. */
-static bfd_boolean
+static lang_output_section_statement_type *
gld${EMULATION_NAME}_place_orphan (asection *s,
const char *secname,
int constraint)
@@ -1723,7 +1723,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
set, then it has been created by the linker, probably as a
result of a --section-start command line switch. */
lang_add_section (&os->children, s, os);
- return TRUE;
+ return os;
}
if (!orphan_init_done)
@@ -1746,9 +1746,9 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
&& CONST_STRNEQ (s->name, ".gnu.warning.")
&& hold[orphan_text].os != NULL)
{
- lang_add_section (&hold[orphan_text].os->children, s,
- hold[orphan_text].os);
- return TRUE;
+ os = hold[orphan_text].os;
+ lang_add_section (&os->children, s, os);
+ return os;
}
/* Decide which segment the section should go in based on the
@@ -1798,9 +1798,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
after = &lang_output_section_statement.head->output_section_statement;
}
- lang_insert_orphan (s, secname, constraint, after, place, NULL, NULL);
-
- return TRUE;
+ return lang_insert_orphan (s, secname, constraint, after, place, NULL, NULL);
}
EOF
fi
diff --git a/ld/emultempl/mmo.em b/ld/emultempl/mmo.em
index 4ff9846..f5ba6dd 100644
--- a/ld/emultempl/mmo.em
+++ b/ld/emultempl/mmo.em
@@ -46,7 +46,7 @@ fragment <<EOF
SEC_READONLY sections right after MMO_TEXT_SECTION_NAME. Much borrowed
from elf32.em. */
-static bfd_boolean
+static lang_output_section_statement_type *
mmo_place_orphan (asection *s,
const char *secname,
int constraint ATTRIBUTE_UNUSED)
@@ -64,7 +64,7 @@ mmo_place_orphan (asection *s,
/* We have nothing to say for anything other than a final link. */
if (link_info.relocatable
|| (s->flags & (SEC_EXCLUDE | SEC_LOAD)) != SEC_LOAD)
- return FALSE;
+ return NULL;
/* Only care for sections we're going to load. */
os = lang_output_section_find (secname);
@@ -74,13 +74,13 @@ mmo_place_orphan (asection *s,
if (os != NULL)
{
lang_add_section (&os->children, s, os);
- return TRUE;
+ return os;
}
/* If this section does not have .text-type section flags or there's no
MMO_TEXT_SECTION_NAME, we don't have anything to say. */
if ((s->flags & (SEC_CODE | SEC_READONLY)) == 0)
- return FALSE;
+ return NULL;
if (hold_text.os == NULL)
hold_text.os = lang_output_section_find (hold_text.name);
@@ -102,7 +102,7 @@ mmo_place_orphan (asection *s,
if (hold_text.os == NULL)
hold_text.os = os;
- return TRUE;
+ return os;
}
/* Remove the spurious settings of SEC_RELOC that make it to the output at
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index b014257..b963d03 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1612,7 +1612,7 @@ gld_${EMULATION_NAME}_finish (void)
default linker script using wildcards, and are sorted by
sort_sections. */
-static bfd_boolean
+static lang_output_section_statement_type *
gld_${EMULATION_NAME}_place_orphan (asection *s,
const char *secname,
int constraint)
@@ -1768,7 +1768,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
}
}
- return TRUE;
+ return os;
}
static bfd_boolean
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index 386c98f..d70f635 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -1371,7 +1371,7 @@ gld_${EMULATION_NAME}_finish (void)
default linker script using wildcards, and are sorted by
sort_sections. */
-static bfd_boolean
+static lang_output_section_statement_type *
gld_${EMULATION_NAME}_place_orphan (asection *s,
const char *secname,
int constraint)
@@ -1527,7 +1527,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s,
}
}
- return TRUE;
+ return os;
}
static bfd_boolean
diff --git a/ld/ldemul.c b/ld/ldemul.c
index 567e8ac..826129d 100644
--- a/ld/ldemul.c
+++ b/ld/ldemul.c
@@ -119,12 +119,12 @@ ldemul_open_dynamic_archive (const char *arch, search_dirs_type *search,
return FALSE;
}
-bfd_boolean
+lang_output_section_statement_type *
ldemul_place_orphan (asection *s, const char *name, int constraint)
{
if (ld_emulation->place_orphan)
return (*ld_emulation->place_orphan) (s, name, constraint);
- return FALSE;
+ return NULL;
}
void
diff --git a/ld/ldemul.h b/ld/ldemul.h
index 6561258..8c68a88 100644
--- a/ld/ldemul.h
+++ b/ld/ldemul.h
@@ -58,7 +58,7 @@ extern void ldemul_set_symbols
(void);
extern void ldemul_create_output_section_statements
(void);
-extern bfd_boolean ldemul_place_orphan
+extern lang_output_section_statement_type *ldemul_place_orphan
(asection *, const char *, int);
extern bfd_boolean ldemul_parse_args
(int, char **);
@@ -151,7 +151,7 @@ typedef struct ld_emulation_xfer_struct {
/* Place an orphan section. Return TRUE if it was placed, FALSE if
the default action should be taken. This field may be NULL, in
which case the default action will always be taken. */
- bfd_boolean (*place_orphan)
+ lang_output_section_statement_type *(*place_orphan)
(asection *, const char *, int);
/* Run after assigning parsing with the args, but before