Home
last modified time | relevance | path

Searched refs:asmscn (Results 1 – 12 of 12) sorted by relevance

/external/elfutils/libasm/
Dasm_align.c43 asm_align (AsmScn_t *asmscn, GElf_Word value) in asm_align() argument
45 if (asmscn == NULL) in asm_align()
56 if (unlikely (asmscn->ctx->textp)) in asm_align()
58 fprintf (asmscn->ctx->out.file, "\t.align %" PRId32 ", ", in asm_align()
60 if (asmscn->pattern->len == 1) in asm_align()
61 fprintf (asmscn->ctx->out.file, "%02hhx\n", asmscn->pattern->bytes[0]); in asm_align()
64 fputc_unlocked ('"', asmscn->ctx->out.file); in asm_align()
66 for (size_t cnt = 0; cnt < asmscn->pattern->len; ++cnt) in asm_align()
67 fprintf (asmscn->ctx->out.file, "\\x%02hhx", in asm_align()
68 asmscn->pattern->bytes[cnt]); in asm_align()
[all …]
Dasm_addstrz.c43 asm_addstrz (AsmScn_t *asmscn, const char *str, size_t len) in asm_addstrz() argument
45 if (asmscn == NULL) in asm_addstrz()
48 if (unlikely (asmscn->type == SHT_NOBITS)) in asm_addstrz()
74 if (unlikely (asmscn->ctx->textp)) in asm_addstrz()
82 fputs ("\t.string\t\"", asmscn->ctx->out.file); in asm_addstrz()
87 fputs ("\\000", asmscn->ctx->out.file); in asm_addstrz()
89 fprintf (asmscn->ctx->out.file, "\\%03o", in asm_addstrz()
92 fputs ("\\\\", asmscn->ctx->out.file); in asm_addstrz()
95 fputs ("\\n\"", asmscn->ctx->out.file); in asm_addstrz()
99 fputc (*str, asmscn->ctx->out.file); in asm_addstrz()
[all …]
Dasm_newsym.c44 asm_newsym (AsmScn_t *asmscn, const char *name, GElf_Xword size, in asm_newsym() argument
51 if (asmscn == NULL) in asm_newsym()
67 snprintf (tempsym, TEMPSYMLEN, ".L%07u", asmscn->ctx->tempsym_count++); in asm_newsym()
78 rwlock_wrlock (asmscn->ctx->lock); in asm_newsym()
80 result->scn = asmscn; in asm_newsym()
81 result->offset = asmscn->offset; in asm_newsym()
86 result->strent = ebl_strtabadd (asmscn->ctx->symbol_strtab, in asm_newsym()
89 if (unlikely (asmscn->ctx->textp)) in asm_newsym()
95 fprintf (asmscn->ctx->out.file, "\t.globl\t%s\n", name); in asm_newsym()
97 fprintf (asmscn->ctx->out.file, "\t.weak\t%s\n", name); in asm_newsym()
[all …]
Dasm_addint8.c54 FCT(SIZE) (AsmScn_t *asmscn, TYPE(SIZE) num) in FCT()
56 if (asmscn == NULL) in FCT()
59 if (asmscn->type == SHT_NOBITS && unlikely (num != 0)) in FCT()
65 if (unlikely (asmscn->ctx->textp)) in FCT()
69 fprintf (asmscn->ctx->out.file, "\t.byte\t%" PRId8 "\n", (int8_t) num); in FCT()
71 fprintf (asmscn->ctx->out.file, "\t.value\t%" PRId16 "\n", in FCT()
74 fprintf (asmscn->ctx->out.file, "\t.long\t%" PRId32 "\n", in FCT()
79 bool is_leb = (elf_getident (asmscn->ctx->out.elf, NULL)[EI_DATA] in FCT()
82 fprintf (asmscn->ctx->out.file, in FCT()
93 bool is_leb = (elf_getident (asmscn->ctx->out.elf, NULL)[EI_DATA] in FCT()
[all …]
Dasm_adduleb128.c41 asm_adduleb128 (AsmScn_t *asmscn, uint32_t num) in asm_adduleb128() argument
43 if (asmscn == NULL) in asm_adduleb128()
46 if (asmscn->type == SHT_NOBITS && unlikely (num != 0)) in asm_adduleb128()
52 if (unlikely (asmscn->ctx->textp)) in asm_adduleb128()
53 fprintf (asmscn->ctx->out.file, "\t.uleb128\t%" PRIu32 "\n", num); in asm_adduleb128()
78 if (__libasm_ensure_section_space (asmscn, nbytes) != 0) in asm_adduleb128()
82 if (likely (asmscn->type != SHT_NOBITS)) in asm_adduleb128()
83 memcpy (&asmscn->content->data[asmscn->content->len], tmpbuf, nbytes); in asm_adduleb128()
86 asmscn->content->len += nbytes; in asm_adduleb128()
89 asmscn->offset += nbytes; in asm_adduleb128()
Dlibasm.h96 extern AsmScn_t *asm_newsubscn (AsmScn_t *asmscn, unsigned int nr);
109 extern int asm_addstrz (AsmScn_t *asmscn, const char *str, size_t len);
112 extern int asm_addint8 (AsmScn_t *asmscn, int8_t num);
115 extern int asm_adduint8 (AsmScn_t *asmscn, uint8_t num);
118 extern int asm_addint16 (AsmScn_t *asmscn, int16_t num);
121 extern int asm_adduint16 (AsmScn_t *asmscn, uint16_t num);
124 extern int asm_addint32 (AsmScn_t *asmscn, int32_t num);
127 extern int asm_adduint32 (AsmScn_t *asmscn, uint32_t num);
130 extern int asm_addint64 (AsmScn_t *asmscn, int64_t num);
133 extern int asm_adduint64 (AsmScn_t *asmscn, uint64_t num);
[all …]
Dasm_addsleb128.c41 asm_addsleb128 (AsmScn_t *asmscn, int32_t num) in asm_addsleb128() argument
43 if (asmscn == NULL) in asm_addsleb128()
46 if (asmscn->type == SHT_NOBITS && unlikely (num != 0)) in asm_addsleb128()
52 if (unlikely (asmscn->ctx->textp)) in asm_addsleb128()
53 fprintf (asmscn->ctx->out.file, "\t.sleb128\t%" PRId32 "\n", num); in asm_addsleb128()
82 if (__libasm_ensure_section_space (asmscn, nbytes) != 0) in asm_addsleb128()
86 if (likely (asmscn->type != SHT_NOBITS)) in asm_addsleb128()
87 memcpy (&asmscn->content->data[asmscn->content->len], tmpbuf, nbytes); in asm_addsleb128()
90 asmscn->content->len += nbytes; in asm_addsleb128()
93 asmscn->offset += nbytes; in asm_addsleb128()
Dasm_newsubscn.c41 asm_newsubscn (AsmScn_t *asmscn, unsigned int nr) in asm_newsubscn() argument
48 if (asmscn == NULL) in asm_newsubscn()
52 runp = asmscn->subsection_id == 0 ? asmscn : asmscn->data.up; in asm_newsubscn()
90 newp->pattern = asmscn->pattern; in asm_newsubscn()
Dasm_end.c82 AsmScn_t *asmscn; in binary_end() local
87 for (asmscn = ctx->section_list; asmscn != NULL; asmscn = asmscn->allnext) in binary_end()
90 Elf_Scn *scn = elf_getscn (ctx->out.elf, asmscn->data.main.scnndx); in binary_end()
92 Elf_Scn *scn = asmscn->data.main.scn; in binary_end()
95 AsmScn_t *asmsubscn = asmscn; in binary_end()
420 for (asmscn = ctx->section_list; asmscn != NULL; asmscn = asmscn->allnext) in binary_end()
422 shdr = gelf_getshdr (asmscn->data.main.scn, &shdr_mem); in binary_end()
426 shdr->sh_name = ebl_strtaboffset (asmscn->data.main.strent); in binary_end()
429 shdr->sh_addralign = asmscn->max_align; in binary_end()
431 (void) gelf_update_shdr (asmscn->data.main.scn, shdr); in binary_end()
Dasm_fill.c42 asm_fill (AsmScn_t *asmscn, void *bytes, size_t len) in asm_fill() argument
47 if (asmscn == NULL) in asm_fill()
66 old_pattern = asmscn->pattern; in asm_fill()
67 asmscn->pattern = pattern; in asm_fill()
DlibasmP.h264 extern int __libasm_ensure_section_space (AsmScn_t *asmscn, size_t len)
281 extern int __asm_addint8_internal (AsmScn_t *asmscn, int8_t num)
283 extern int __asm_addint16_internal (AsmScn_t *asmscn, int16_t num)
285 extern int __asm_addint32_internal (AsmScn_t *asmscn, int32_t num)
287 extern int __asm_addint64_internal (AsmScn_t *asmscn, int64_t num)
Dasm_adduint8.c51 UFCT(SIZE) (AsmScn_t *asmscn, UTYPE(SIZE) num) in UFCT()
53 return INTUSE(FCT(SIZE)) (asmscn, (TYPE(SIZE)) num); in UFCT()