Commits

Aram Hăvărneanu committed f11a278

cmd/ld, cmd/6l: address iant's review points

  • Participants
  • Parent commits 2afc55b

Comments (0)

Files changed (2)

 		return;
 	
 	case D_ADDR:
-		if(s->type == STEXT) {
+		if(s->type == STEXT && iself) {
 			// The code is asking for the address of an external
 			// function.  We provide it with the address of the
 			// correspondent GOT symbol.

src/cmd/ld/data.c

 					rs = rs->outer;
 				}
 				r->xadd -= r->siz; // relative to address after the relocated chunk
-				if(rs->type != SHOSTOBJ && rs->sect == nil)
-				if(rs->type != SDYNIMPORT)
+				if(rs->type != SHOSTOBJ && rs->type != SDYNIMPORT && rs->sect == nil)
 					diag("missing section for %s", rs->name);
 				r->xsym = rs;