From: "H. J. Lu" <hjl@lucon.org>
To: binutils@sources.redhat.com
Subject: PATCH: PR 992: regression: ld selective1 and selective2 fails, cris-elf
Date: Sat, 04 Jun 2005 06:35:00 -0000 [thread overview]
Message-ID: <20050604063551.GA16809@lucon.org> (raw)
The updated patch of
http://sourceware.org/ml/binutils/2005-06/msg00030.html
should also fix PR 992.
H.J.
---
2005-06-03 H.J. Lu <hongjiu.lu@intel.com>
PR 992
* ldexp.c (exp_mark_used_section): Set SEC_KEEP on current
section for etree_assign, etree_provide and etree_provided.
Call fold_binary on etree_binary.
* ldlang.c (lang_mark_used_section_1): Handle load base.
--- ld/ldexp.c.base 2005-06-02 16:02:26.000000000 -0700
+++ ld/ldexp.c 2005-06-03 23:16:33.000000000 -0700
@@ -1217,6 +1217,8 @@ align_n (bfd_vma value, bfd_vma align)
void
exp_mark_used_section (etree_type *tree, asection *current_section)
{
+ bfd_vma dot = 0;
+
switch (tree->type.node_class)
{
case etree_value:
@@ -1232,6 +1234,8 @@ exp_mark_used_section (etree_type *tree,
break;
case etree_binary:
+ fold_binary (tree, current_section, lang_allocating_phase_enum,
+ dot, &dot, TRUE);
break;
case etree_trinary:
@@ -1243,12 +1247,12 @@ exp_mark_used_section (etree_type *tree,
if (tree->assign.dst[0] != '.' || tree->assign.dst[1] != 0)
{
etree_value_type result;
- bfd_vma dot = 0;
result = exp_fold_tree_1 (tree->assign.src,
current_section,
lang_allocating_phase_enum,
dot, &dot, TRUE);
+ current_section->flags |= SEC_KEEP;
if (result.valid_p)
{
bfd_boolean create;
--- ld/ldlang.c.base 2005-06-03 22:28:20.000000000 -0700
+++ ld/ldlang.c 2005-06-03 22:54:05.000000000 -0700
@@ -3065,7 +3065,12 @@ lang_mark_used_section_1
os = &(s->output_section_statement);
if (os->bfd_section != NULL)
- lang_mark_used_section_1 (os->children.head, os);
+ {
+ lang_mark_used_section_1 (os->children.head, os);
+ if (os->load_base)
+ exp_mark_used_section (os->load_base,
+ bfd_abs_section_ptr);
+ }
}
break;
case lang_wild_statement_enum:
next reply other threads:[~2005-06-04 6:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-04 6:35 H. J. Lu [this message]
2005-06-04 13:45 ` H. J. Lu
2005-06-04 15:08 ` Alan Modra
2005-06-04 19:58 ` H. J. Lu
2005-06-05 1:40 ` Hans-Peter Nilsson
2005-06-05 7:39 ` Nick Clifton
2005-06-09 1:58 ` Alan Modra
2005-06-09 2:58 ` Alan Modra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050604063551.GA16809@lucon.org \
--to=hjl@lucon.org \
--cc=binutils@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).