From 4030d1c97bdd6ebc7bb68a821d234f11595956e6 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Fri, 18 May 2012 23:08:28 +0000 Subject: [PATCH] Exposing asm_set_function() and asm_set_section() for now --- include/Asm/asm.h | 6 +++++- src/asm.c | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/Asm/asm.h b/include/Asm/asm.h index 646d73b..2bc5ef3 100644 --- a/include/Asm/asm.h +++ b/include/Asm/asm.h @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2011 Pierre Pronchery */ +/* Copyright (c) 2011-2012 Pierre Pronchery */ /* This file is part of DeforaOS Devel asm */ /* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,6 +47,10 @@ int asm_set_arch(Asm * a, char const * arch); char const * asm_get_format(Asm * a); int asm_set_format(Asm * a, char const * format); +int asm_set_function(Asm * a, char const * name, off_t offset, ssize_t size); +int asm_set_section(Asm * a, char const * name, off_t offset, ssize_t size, + off_t base); + /* useful */ /* detection */ diff --git a/src/asm.c b/src/asm.c index 3ea5fdf..81e074c 100644 --- a/src/asm.c +++ b/src/asm.c @@ -160,6 +160,14 @@ int asm_set_function(Asm * a, char const * name, off_t offset, ssize_t size) } +/* asm_set_section */ +int asm_set_section(Asm * a, char const * name, off_t offset, ssize_t size, + off_t base) +{ + return asmcode_set_section(a->code, -1, name, offset, size, base); +} + + /* useful */ /* asm_assemble */ int asm_assemble(Asm * a, AsmPrefs * prefs, char const * infile,