aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-05-17 19:38:53 +0000
committerNick Clifton <nickc@redhat.com>2000-05-17 19:38:53 +0000
commita712da2085bdea09bc56b3a59eb31cf2ab024e00 (patch)
tree9d61a41f3e2b546bf10eacd972952c6118c70970 /bfd
parentf4bd37dad4bc492df305f32652ba812fef893420 (diff)
downloadgdb-a712da2085bdea09bc56b3a59eb31cf2ab024e00.zip
gdb-a712da2085bdea09bc56b3a59eb31cf2ab024e00.tar.gz
gdb-a712da2085bdea09bc56b3a59eb31cf2ab024e00.tar.bz2
Apply patch from Richard Gorton <gorton@scrugs.lkg.dec.com> to implement
--emit-relocs switch to the linker to preserve relocs in an output executable
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog16
-rw-r--r--bfd/elflink.h13
2 files changed, 19 insertions, 10 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 5dbe6a2..5e98cb9 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,13 @@
+2000-05-17 S. Bharadwaj Yadavalli <sby@scrugs.lkg.dec.com>
+ Rick Gorton <gorton@scrugs.lkg.dec.com>
+
+ * elflink.h: Add emitrelocations support: when enabled, relocation
+ information and relocation sections are put into final output
+ executables. If the emitrelocations flag is set, do the following:
+ (elf_bfd_final_link): Emit relocation sections.
+ (elf_link_input_bfd): Compute relocation section contents.
+ (elf_gc_sections): Don't clean relocation sections.
+
2000-05-16 Catherine Moore <clm@cygnux.com>
* som.c (som_decode_symclass): Recognize weak symbols.
@@ -1246,7 +1256,7 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com)
2000-02-08 Mark Elbrecht <snowball3@bigfoot.com>
* coff-go32.c: Update comment. Update copyright.
-
+
2000-01-27 Thomas de Lellis <tdel@windriver.com>
* syms.c (bfd_decode_symclass)
@@ -2603,8 +2613,8 @@ Mon Jul 19 14:03:44 1999 Mark P. Mitchell <mark@codesourcery.com>
* coffcode.h (CREATE_BIG_COFF_TARGET_VEC): New macro.
(CREATE_LITTLE_COFF_TARGET_VEC): New macro.
- * aix386-core.c: Initialise new field of bfd_target structure.
- * aout-adobe.c: Initialise new field of bfd_target structure.
+ * aix386-core.c: Initialise new field of bfd_target structure.
+ * aout-adobe.c: Initialise new field of bfd_target structure.
* aout-arm.c: Initialise new field of bfd_target structure.
* aout-target.h: Initialise new field of bfd_target structure.
* aout-tic30.c: Initialise new field of bfd_target structure.
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 16f2f98..fc3f1d1 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -357,7 +357,6 @@ elf_link_add_archive_symbols (abfd, info)
}
/* We need to include this archive member. */
-
element = _bfd_get_elt_at_filepos (abfd, symdef->file_offset);
if (element == (bfd *) NULL)
goto error_return;
@@ -4104,7 +4103,7 @@ elf_bfd_final_link (abfd, info)
the linker has decided to not include. */
sec->linker_mark = true;
- if (info->relocateable)
+ if (info->relocateable || info->emitrelocations)
o->reloc_count += sec->reloc_count;
if (sec->_raw_size > max_contents_size)
@@ -4172,7 +4171,7 @@ elf_bfd_final_link (abfd, info)
/* Figure out how many relocations we will have in each section.
Just using RELOC_COUNT isn't good enough since that doesn't
maintain a separate value for REL vs. RELA relocations. */
- if (info->relocateable)
+ if (info->relocateable || info->emitrelocations)
for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
for (o = sub->sections; o != NULL; o = o->next)
{
@@ -4280,7 +4279,7 @@ elf_bfd_final_link (abfd, info)
/* Start writing out the symbol table. The first symbol is always a
dummy symbol. */
- if (info->strip != strip_all || info->relocateable)
+ if (info->strip != strip_all || info->relocateable || info->emitrelocations)
{
elfsym.st_value = 0;
elfsym.st_size = 0;
@@ -4313,7 +4312,7 @@ elf_bfd_final_link (abfd, info)
symbols have no names. We store the index of each one in the
index field of the section, so that we can find it again when
outputting relocs. */
- if (info->strip != strip_all || info->relocateable)
+ if (info->strip != strip_all || info->relocateable || info->emitrelocations)
{
elfsym.st_size = 0;
elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
@@ -4324,7 +4323,7 @@ elf_bfd_final_link (abfd, info)
if (o != NULL)
o->target_index = bfd_get_symcount (abfd);
elfsym.st_shndx = i;
- if (info->relocateable || o == NULL)
+ if (info->relocateable || info->emitrelocations || o == NULL)
elfsym.st_value = 0;
else
elfsym.st_value = o->vma;
@@ -5492,7 +5491,7 @@ elf_link_input_bfd (finfo, input_bfd)
finfo->sections))
return false;
- if (finfo->info->relocateable)
+ if (finfo->info->relocateable || finfo->info->emitrelocations)
{
Elf_Internal_Rela *irela;
Elf_Internal_Rela *irelaend;