aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorSteve Chamberlain <steve@cygnus>1991-03-27 00:53:16 +0000
committerSteve Chamberlain <steve@cygnus>1991-03-27 00:53:16 +0000
commit9f32f7c27b7c480932cdd1835783b4b40def3280 (patch)
tree12f634c7d6dcaeee85747860dfc55d8679f28e44 /ld/ldlang.c
parentb473cf198e8952376a2b4a1e1225c1fd0251ee20 (diff)
downloadgdb-9f32f7c27b7c480932cdd1835783b4b40def3280.zip
gdb-9f32f7c27b7c480932cdd1835783b4b40def3280.tar.gz
gdb-9f32f7c27b7c480932cdd1835783b4b40def3280.tar.bz2
*** empty log message ***
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c70
1 files changed, 44 insertions, 26 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 0df171f..d6bfe28 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -19,7 +19,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* $Id$
*
* $Log$
- * Revision 1.2 1991/03/22 23:02:34 steve
+ * Revision 1.3 1991/03/27 00:52:49 steve
+ * *** empty log message ***
+ *
+ * Revision 1.2 1991/03/22 23:02:34 steve
* Brought up to sync with Intel again.
*
* Revision 1.3 1991/03/16 22:19:21 rich
@@ -2156,45 +2159,60 @@ char *memspec;
current_section->region = lang_memory_region_lookup(memspec);
stat_ptr = &statement_list;
}
+/*
+ Create an absolute symbol with the given name with the value of the
+ address of first byte of the section named.
+ If the symbol already exists, then do nothing.
+*/
void
lang_abs_symbol_at_beginning_of(section, name)
char *section;
char *name;
{
- extern bfd *output_bfd;
- extern asymbol *create_symbol();
- asection *s = bfd_get_section_by_name(output_bfd, section);
- asymbol *def = create_symbol(name,
- BSF_GLOBAL | BSF_EXPORT |
- BSF_ABSOLUTE,
- (asection *)NULL);
- if (s != (asection *)NULL) {
- def->value = s->vma;
- }
- else {
- def->value = 0;
+ if (ldsym_get_soft(name) == (asymbol *)NULL) {
+ extern bfd *output_bfd;
+ extern asymbol *create_symbol();
+ asection *s = bfd_get_section_by_name(output_bfd, section);
+ asymbol *def = create_symbol(name,
+ BSF_GLOBAL | BSF_EXPORT |
+ BSF_ABSOLUTE,
+ (asection *)NULL);
+ if (s != (asection *)NULL) {
+ def->value = s->vma;
+ }
+ else {
+ def->value = 0;
+ }
}
}
+/*
+ Create an absolute symbol with the given name with the value of the
+ address of the first byte after the end of the section named.
+
+ If the symbol already exists, then do nothing.
+*/
void
lang_abs_symbol_at_end_of(section, name)
char *section;
char *name;
{
- extern bfd *output_bfd;
- extern asymbol *create_symbol();
- asection *s = bfd_get_section_by_name(output_bfd, section);
- /* Add a symbol called _end */
- asymbol *def = create_symbol(name,
- BSF_GLOBAL | BSF_EXPORT |
- BSF_ABSOLUTE,
- (asection *)NULL);
- if (s != (asection *)NULL) {
- def->value = s->vma + s->size;
- }
- else {
- def->value = 0;
+ if (ldsym_get_soft(name) == (asymbol *)NULL) {
+ extern bfd *output_bfd;
+ extern asymbol *create_symbol();
+ asection *s = bfd_get_section_by_name(output_bfd, section);
+ /* Add a symbol called _end */
+ asymbol *def = create_symbol(name,
+ BSF_GLOBAL | BSF_EXPORT |
+ BSF_ABSOLUTE,
+ (asection *)NULL);
+ if (s != (asection *)NULL) {
+ def->value = s->vma + s->size;
+ }
+ else {
+ def->value = 0;
+ }
}
}