Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3552)

Unified Diff: bfd/cofflink.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bfd/coffgen.c ('k') | bfd/compress.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bfd/cofflink.c
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index dd3e4b12ee4840227bbfa1dd498310ad42befc9b..948b4cd0de934157b8dfcc565c139c3b48e4e1b0 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -605,7 +605,7 @@ coff_link_add_symbols (bfd *abfd,
{
bfd_size_type string_offset = 0;
asection *stab;
-
+
for (stab = abfd->sections; stab; stab = stab->next)
if (CONST_STRNEQ (stab->name, ".stab")
&& (!stab->name[5]
@@ -614,7 +614,7 @@ coff_link_add_symbols (bfd *abfd,
struct coff_link_hash_table *table;
struct coff_section_tdata *secdata
= coff_section_data (abfd, stab);
-
+
if (secdata == NULL)
{
amt = sizeof (struct coff_section_tdata);
@@ -1159,7 +1159,7 @@ _bfd_coff_final_link (bfd *abfd,
elsewhere. */
struct internal_reloc incount;
bfd_byte *excount = (bfd_byte *)bfd_malloc (relsz);
-
+
memset (&incount, 0, sizeof (incount));
incount.r_vaddr = o->reloc_count + 1;
bfd_coff_swap_reloc_out (abfd, &incount, excount);
@@ -1424,7 +1424,8 @@ mark_relocs (struct coff_final_link_info *flaginfo, bfd *input_bfd)
struct internal_reloc * irel;
struct internal_reloc * irelend;
- if ((a->flags & SEC_RELOC) == 0 || a->reloc_count < 1)
+ if ((a->flags & SEC_RELOC) == 0 || a->reloc_count < 1
+ || a->linker_mark == 0)
continue;
/* Don't mark relocs in excluded sections. */
if (a->output_section == bfd_abs_section_ptr)
@@ -2426,10 +2427,9 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *flaginfo, bfd *input_bfd)
contents = secdata->contents;
else
{
- bfd_size_type x = o->rawsize ? o->rawsize : o->size;
- if (! bfd_get_section_contents (input_bfd, o, flaginfo->contents, 0, x))
- return FALSE;
contents = flaginfo->contents;
+ if (! bfd_get_full_section_contents (input_bfd, o, &contents))
+ return FALSE;
}
if ((o->flags & SEC_RELOC) != 0)
@@ -2447,7 +2447,8 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *flaginfo, bfd *input_bfd)
? (flaginfo->section_info[target_index].relocs
+ o->output_section->reloc_count)
: flaginfo->internal_relocs)));
- if (internal_relocs == NULL)
+ if (internal_relocs == NULL
+ && o->reloc_count > 0)
return FALSE;
/* Run through the relocs looking for relocs against symbols
« no previous file with comments | « bfd/coffgen.c ('k') | bfd/compress.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698