• Home
  • Raw
  • Download

Lines Matching refs:asmscn

42 asm_align (AsmScn_t *asmscn, GElf_Word value)  in asm_align()  argument
44 if (asmscn == NULL) in asm_align()
55 if (unlikely (asmscn->ctx->textp)) in asm_align()
57 fprintf (asmscn->ctx->out.file, "\t.align %" PRId32 ", ", in asm_align()
59 if (asmscn->pattern->len == 1) in asm_align()
60 fprintf (asmscn->ctx->out.file, "%02hhx\n", asmscn->pattern->bytes[0]); in asm_align()
63 fputc_unlocked ('"', asmscn->ctx->out.file); in asm_align()
65 for (size_t cnt = 0; cnt < asmscn->pattern->len; ++cnt) in asm_align()
66 fprintf (asmscn->ctx->out.file, "\\x%02hhx", in asm_align()
67 asmscn->pattern->bytes[cnt]); in asm_align()
69 fputs_unlocked ("\"\n", asmscn->ctx->out.file); in asm_align()
74 rwlock_wrlock (asmscn->ctx->lock); in asm_align()
79 if ((asmscn->offset & (value - 1)) != 0) in asm_align()
82 size_t cnt = value - (asmscn->offset & (value - 1)); in asm_align()
85 result = __libasm_ensure_section_space (asmscn, cnt); in asm_align()
91 size_t byteptr = asmscn->offset % asmscn->pattern->len; in asm_align()
94 asmscn->offset += cnt; in asm_align()
98 asmscn->content->data[asmscn->content->len++] in asm_align()
99 = asmscn->pattern->bytes[byteptr++]; in asm_align()
101 if (byteptr == asmscn->pattern->len) in asm_align()
108 if (asmscn->max_align < value) in asm_align()
110 asmscn->max_align = value; in asm_align()
113 if (asmscn->subsection_id != 0) in asm_align()
115 rwlock_wrlock (asmscn->data.up->ctx->lock); in asm_align()
117 if (asmscn->data.up->max_align < value) in asm_align()
118 asmscn->data.up->max_align = value; in asm_align()
120 rwlock_unlock (asmscn->data.up->ctx->lock); in asm_align()
125 rwlock_unlock (asmscn->ctx->lock); in asm_align()
135 __libasm_ensure_section_space (AsmScn_t *asmscn, size_t len) in __libasm_ensure_section_space() argument
141 if (asmscn->content == NULL) in __libasm_ensure_section_space()
146 asmscn->content = (struct AsmData *) malloc (sizeof (struct AsmData) in __libasm_ensure_section_space()
148 if (asmscn->content == NULL) in __libasm_ensure_section_space()
151 asmscn->content->next = asmscn->content; in __libasm_ensure_section_space()
157 if (asmscn->content->maxlen - asmscn->content->len >= len) in __libasm_ensure_section_space()
161 size = MAX (2 *len, MIN (32768, 2 * asmscn->offset)); in __libasm_ensure_section_space()
167 newp->next = asmscn->content->next; in __libasm_ensure_section_space()
168 asmscn->content = asmscn->content->next = newp; in __libasm_ensure_section_space()
171 asmscn->content->len = 0; in __libasm_ensure_section_space()
172 asmscn->content->maxlen = size; in __libasm_ensure_section_space()