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

Unified Diff: fusl/src/internal/fdpic_crt.h

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 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
Index: fusl/src/internal/fdpic_crt.h
diff --git a/fusl/src/internal/fdpic_crt.h b/fusl/src/internal/fdpic_crt.h
index 7eb50c6bd12a3b5e1b0ffdf519b0981597368128..0573740b7fae8dae1c62e8ed113886a0fe1e378d 100644
--- a/fusl/src/internal/fdpic_crt.h
+++ b/fusl/src/internal/fdpic_crt.h
@@ -1,28 +1,32 @@
#include <stdint.h>
-__attribute__((__visibility__("hidden")))
-void *__fdpic_fixup(void *map, uintptr_t *a, uintptr_t *z)
-{
- /* If map is a null pointer, the program was loaded by a
- * non-FDPIC-aware ELF loader, and fixups are not needed,
- * but the value for the GOT pointer is. */
- if (!map) return (void *)z[-1];
+__attribute__((__visibility__("hidden"))) void* __fdpic_fixup(void* map,
+ uintptr_t* a,
+ uintptr_t* z) {
+ /* If map is a null pointer, the program was loaded by a
+ * non-FDPIC-aware ELF loader, and fixups are not needed,
+ * but the value for the GOT pointer is. */
+ if (!map)
+ return (void*)z[-1];
- struct {
- unsigned short version, nsegs;
- struct fdpic_loadseg {
- uintptr_t addr, p_vaddr, p_memsz;
- } segs[];
- } *lm = map;
- int nsegs = lm->nsegs, rseg = 0, vseg = 0;
- for (;;) {
- while (*a-lm->segs[rseg].p_vaddr >= lm->segs[rseg].p_memsz)
- if (++rseg == nsegs) rseg = 0;
- uintptr_t *r = (uintptr_t *)
- (*a + lm->segs[rseg].addr - lm->segs[rseg].p_vaddr);
- if (++a == z) return r;
- while (*r-lm->segs[vseg].p_vaddr >= lm->segs[vseg].p_memsz)
- if (++vseg == nsegs) vseg = 0;
- *r += lm->segs[vseg].addr - lm->segs[vseg].p_vaddr;
- }
+ struct {
+ unsigned short version, nsegs;
+ struct fdpic_loadseg {
+ uintptr_t addr, p_vaddr, p_memsz;
+ } segs[];
+ }* lm = map;
+ int nsegs = lm->nsegs, rseg = 0, vseg = 0;
+ for (;;) {
+ while (*a - lm->segs[rseg].p_vaddr >= lm->segs[rseg].p_memsz)
+ if (++rseg == nsegs)
+ rseg = 0;
+ uintptr_t* r =
+ (uintptr_t*)(*a + lm->segs[rseg].addr - lm->segs[rseg].p_vaddr);
+ if (++a == z)
+ return r;
+ while (*r - lm->segs[vseg].p_vaddr >= lm->segs[vseg].p_memsz)
+ if (++vseg == nsegs)
+ vseg = 0;
+ *r += lm->segs[vseg].addr - lm->segs[vseg].p_vaddr;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698