diff ticoff/reloc.c @ 113:d97fbe98600b

tiobjd: recognizing relocs in ldr literals
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 03 Apr 2014 06:20:06 +0000
parents e650fdc743fe
children 2f23301d2f86
line wrap: on
line diff
--- a/ticoff/reloc.c	Thu Apr 03 05:54:59 2014 +0000
+++ b/ticoff/reloc.c	Thu Apr 03 06:20:06 2014 +0000
@@ -123,3 +123,21 @@
 	}
 	exit(0);
 }
+
+struct internal_reloc *
+find_reloc(sec, loc)
+	struct internal_scnhdr *sec;
+	unsigned loc;
+{
+	struct internal_reloc *rel;
+	unsigned m;
+
+	rel = sec->int_relocs;
+	for (m = 0; m < sec->nreloc; m++, rel++) {
+		if (rel->location == loc)
+			return(rel);
+		if (rel->location > loc)
+			return(0);
+	}
+	return(0);
+}