This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ARM long branch stubs: cleanup
- From: Paul Brook <paul at codesourcery dot com>
- To: binutils at sourceware dot org
- Cc: Christophe LYON <christophe dot lyon at st dot com>
- Date: Mon, 9 Mar 2009 13:03:57 +0000
- Subject: Re: ARM long branch stubs: cleanup
- References: <49B157BD.4090609@st.com>
On Friday 06 March 2009, Christophe LYON wrote:
> Hi all,
>
> With the attached small patch, I propose to remove an error-prone switch
> statement to get the correct stub template and size in arm_size_one_stub().
> It is replaced by an (error-prone :-) array defined next to the stub
> themselves.
>
> Maybe it would save some maintenance issues.
If you rework the preprocessor macros a bit you can generate both the enum and
the array from the same list.
Something along the lines of
#define DEF_STUBS DEF_STUB(long_branch_any)[...]
#define DEF_STUB(x) arm_stub_##x,
enum{
DEF_STUBS
}
#undef DEF_STUB
#define DEF_STUB(x) elf32_arm_stub_##x,
static const stub_def stub_definitions[] = {
DEF_STUBS
}
Paul