aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-03-20 17:40:06 +0000
committerIan Lance Taylor <ian@airs.com>1997-03-20 17:40:06 +0000
commit34bc6ffca64341d3313c57c6b459e79045df987c (patch)
treed7ed0cebdfcc179b01edde362b308b60c9cbb42b /bfd/elflink.h
parent9e3977b9df079a4848d98c83b0c385c0f9c34c8d (diff)
downloadgdb-34bc6ffca64341d3313c57c6b459e79045df987c.zip
gdb-34bc6ffca64341d3313c57c6b459e79045df987c.tar.gz
gdb-34bc6ffca64341d3313c57c6b459e79045df987c.tar.bz2
* elflink.h (elf_bfd_final_link): Set the value of a section
symbol to the section address unless doing a relocateable link.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index dee5a8a..6207595 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -3328,7 +3328,6 @@ elf_bfd_final_link (abfd, info)
outputting relocs. */
if (info->strip != strip_all || info->relocateable)
{
- elfsym.st_value = 0;
elfsym.st_size = 0;
elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
elfsym.st_other = 0;
@@ -3338,6 +3337,10 @@ elf_bfd_final_link (abfd, info)
if (o != NULL)
o->target_index = abfd->symcount;
elfsym.st_shndx = i;
+ if (info->relocateable || o == NULL)
+ elfsym.st_value = 0;
+ else
+ elfsym.st_value = o->vma;
if (! elf_link_output_sym (&finfo, (const char *) NULL,
&elfsym, o))
goto error_return;