aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorSteve Chamberlain <steve@cygnus>1991-04-18 00:06:26 +0000
committerSteve Chamberlain <steve@cygnus>1991-04-18 00:06:26 +0000
commitac004870235360534206643bedf3591ea832b59f (patch)
treee202d73f5b6eddb237eb86bad8483ad44a06e1c7 /ld/ldlang.c
parent301dfc71d4d0d371cd747d11b81ea3b002e48876 (diff)
downloadgdb-ac004870235360534206643bedf3591ea832b59f.zip
gdb-ac004870235360534206643bedf3591ea832b59f.tar.gz
gdb-ac004870235360534206643bedf3591ea832b59f.tar.bz2
Fixed some bugs.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index e63f899..afbc385 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1247,23 +1247,28 @@ DEFUN(size_input_section, (this_ptr, output_section_statement, fill, dot),
asection *i = is->section;
if (is->ifile->just_syms_flag == false) {
- dot = insert_pad(this_ptr, fill, i->alignment_power,
- output_section_statement->bfd_section, dot);
+ dot = insert_pad(this_ptr, fill, i->alignment_power,
+ output_section_statement->bfd_section, dot);
- /* remember the largest size so we can malloc the largest area */
- /* needed for the output stage */
- if (i->size > largest_section) {
- largest_section = i->size;
- }
+ /* remember the largest size so we can malloc the largest area */
+ /* needed for the output stage */
+ if (i->size > largest_section) {
+ largest_section = i->size;
+ }
- /* Remember where in the output section this input section goes */
- i->output_offset = dot - output_section_statement->bfd_section->vma;
+ /* Remember where in the output section this input section goes */
- /* Mark how big the output section must be to contain this now */
- dot += i->size;
- output_section_statement->bfd_section->size =
- dot - output_section_statement->bfd_section->vma;
-}
+ i->output_offset = dot - output_section_statement->bfd_section->vma;
+
+ /* Mark how big the output section must be to contain this now */
+ dot += i->size;
+ output_section_statement->bfd_section->size =
+ dot - output_section_statement->bfd_section->vma;
+ }
+ else
+ {
+ i->output_offset = i->vma - output_section_statement->bfd_section->vma;
+ }
return dot ;
}
@@ -1718,8 +1723,10 @@ DEFUN_VOID(lang_common)
com->section->alignment_power = power_of_two;
}
+ /* Symbol stops being common and starts being global, but
+ we remember that it was common once. */
- com->flags = BSF_EXPORT | BSF_GLOBAL ;
+ com->flags = BSF_EXPORT | BSF_GLOBAL | BSF_OLD_COMMON;
if (write_map)
@@ -1731,7 +1738,6 @@ DEFUN_VOID(lang_common)
}
com->value = com->section->size;
com->section->size += size;
- com->the_bfd = output_bfd;
}