aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2006-09-27 04:18:16 +0000
committerH.J. Lu <hjl.tools@gmail.com>2006-09-27 04:18:16 +0000
commit49c13adb16c432e9d04770f7c6b8348e31bb1df1 (patch)
tree4169c5e520d6c3228abd35ebf85228ca9cda9375 /ld/ldlang.c
parentf36b9bcd93570f658ebfe3c6946409eed2533e6d (diff)
downloadgdb-49c13adb16c432e9d04770f7c6b8348e31bb1df1.zip
gdb-49c13adb16c432e9d04770f7c6b8348e31bb1df1.tar.gz
gdb-49c13adb16c432e9d04770f7c6b8348e31bb1df1.tar.bz2
bfd/
2006-09-26 H.J. Lu <hongjiu.lu@intel.com> PR ld/3223 PR ld/3267 * elf.c (assign_file_positions_for_non_load_sections): Don't warn zero size allocated sections. ld/ 2006-09-26 H.J. Lu <hongjiu.lu@intel.com> PR ld/3223 PR ld/3267 * ld.texinfo: Updated Output Section Discarding. * ldlang.h (lang_output_section_statement_type): Add section_relative_symbol. * ldlang.c (strip_excluded_output_sections): Don't strip a section with a symbol relative to it. (lang_size_sections_1): Mark if an output section has a symbol symbol relative to it. ld/testsuite/ 2006-09-26 H.J. Lu <hongjiu.lu@intel.com> PR ld/3223 PR ld/3267 * ld-scripts/empty-address-1.d: New file. * ld-scripts/empty-address-1.s: Likewise. * ld-scripts/empty-address-1.t: Likewise. * ld-scripts/empty-address-2.s: Likewise. * ld-scripts/empty-address-2a.d: Likewise. * ld-scripts/empty-address-2a.t: Likewise. * ld-scripts/empty-address-2b.d: Likewise. * ld-scripts/empty-address-2b.t: Likewise. * ld-scripts/empty-address-3.s: Likewise. * ld-scripts/empty-address-3a.d: Likewise. * ld-scripts/empty-address-3a.t: Likewise. * ld-scripts/empty-address-3b.d: Likewise. * ld-scripts/empty-address-3b.t: Likewise. * ld-scripts/empty-address-3c.d: Likewise. * ld-scripts/empty-address-3c.t: Likewise. * ld-scripts/empty-address.exp: Likewise.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 8b6cbd2..4ce3c93 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -3342,6 +3342,7 @@ strip_excluded_output_sections (void)
continue;
exclude = (output_section->rawsize == 0
+ && !os->section_relative_symbol
&& (output_section->flags & SEC_KEEP) == 0
&& !bfd_section_removed_from_list (output_bfd,
output_section));
@@ -4629,11 +4630,19 @@ lang_size_sections_1
case lang_assignment_statement_enum:
{
bfd_vma newdot = dot;
+ etree_type *tree = s->assignment_statement.exp;
- exp_fold_tree (s->assignment_statement.exp,
+ exp_fold_tree (tree,
output_section_statement->bfd_section,
&newdot);
+ /* This symbol is relative to this section. */
+ if ((tree->type.node_class == etree_provided
+ || tree->type.node_class == etree_assign)
+ && (tree->assign.dst [0] != '.'
+ || tree->assign.dst [1] != '\0'))
+ output_section_statement->section_relative_symbol = 1;
+
if (!output_section_statement->ignored)
{
if (output_section_statement == abs_output_section)