Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Delta Between Two Patch Sets: src/cmd/ld/ldmacho.c

Issue 10345046: code review 10345046: cmd/ld: handle duplicate static symbols in COFF files. (Closed)
Left Patch Set: diff -r b2560a1d1e52 https://code.google.com/p/go Created 11 years, 9 months ago
Right Patch Set: diff -r c2eadf102468 https://code.google.com/p/go Created 11 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « misc/cgo/test/issue5740b.c ('k') | src/cmd/ld/ldpe.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 /* 1 /*
2 Derived from Plan 9 from User Space's src/libmach/elf.h, elf.c 2 Derived from Plan 9 from User Space's src/libmach/elf.h, elf.c
3 http://code.swtch.com/plan9port/src/tip/src/libmach/ 3 http://code.swtch.com/plan9port/src/tip/src/libmach/
4 4
5 Copyright © 2004 Russ Cox. 5 Copyright © 2004 Russ Cox.
6 Portions Copyright © 2008-2010 Google Inc. 6 Portions Copyright © 2008-2010 Google Inc.
7 Portions Copyright © 2010 The Go Authors. 7 Portions Copyright © 2010 The Go Authors.
8 8
9 Permission is hereby granted, free of charge, to any person obtaining a copy 9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal 10 of this software and associated documentation files (the "Software"), to deal
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 if(sym->type&N_STAB) 604 if(sym->type&N_STAB)
605 continue; 605 continue;
606 // TODO: check sym->type against outer->type. 606 // TODO: check sym->type against outer->type.
607 name = sym->name; 607 name = sym->name;
608 if(name[0] == '_' && name[1] != '\0') 608 if(name[0] == '_' && name[1] != '\0')
609 name++; 609 name++;
610 v = 0; 610 v = 0;
611 if(!(sym->type&N_EXT)) 611 if(!(sym->type&N_EXT))
612 v = version; 612 v = version;
613 s = lookup(name, v); 613 s = lookup(name, v);
614 if(!(sym->type&N_EXT))
615 s->dupok = 1;
614 sym->sym = s; 616 sym->sym = s;
615 if(sym->sectnum == 0) // undefined 617 if(sym->sectnum == 0) // undefined
616 continue; 618 continue;
617 if(sym->sectnum > c->seg.nsect) { 619 if(sym->sectnum > c->seg.nsect) {
618 werrstr("reference to invalid section %d", sym->sectnum) ; 620 werrstr("reference to invalid section %d", sym->sectnum) ;
619 goto bad; 621 goto bad;
620 } 622 }
621 sect = &c->seg.sect[sym->sectnum-1]; 623 sect = &c->seg.sect[sym->sectnum-1];
622 outer = sect->sym; 624 outer = sect->sym;
623 if(outer == nil) { 625 if(outer == nil) {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 }······················· 847 }·······················
846 qsort(r, rp - r, sizeof r[0], rbyoff); 848 qsort(r, rp - r, sizeof r[0], rbyoff);
847 s->r = r; 849 s->r = r;
848 s->nr = rp - r; 850 s->nr = rp - r;
849 } 851 }
850 return; 852 return;
851 853
852 bad: 854 bad:
853 diag("%s: malformed mach-o file: %r", pn); 855 diag("%s: malformed mach-o file: %r", pn);
854 } 856 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b