From: Scott Wood Date: Tue, 8 Oct 2013 10:06:07 -0500 Subject: [U-Boot] [PATCH 1/4] arm64: Add tool to statically apply RELA relocations In-Reply-To: <1cbe37a.17885.141987258b0.Coremail.fenghua@phytium.com.cn> References: <1380840511-7414-1-git-send-email-scottwood@freescale.com> <1380840511-7414-2-git-send-email-scottwood@freescale.com> <1cbe37a.17885.141987258b0.Coremail.fenghua@phytium.com.cn> Message-ID: <1381244767.7979.208.camel@snotra.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 2013-10-08 at 22:22 +0800, FengHua wrote: > > diff --git a/tools/relocate-rela.c b/tools/relocate-rela.c > > new file mode 100644 > > index 0000000..47afe0b > > --- /dev/null > > +++ b/tools/relocate-rela.c > > @@ -0,0 +1,185 @@ > > +/* > > + * Copyright 2013 Freescale Semiconductor, Inc. > > + * > > + * SPDX-License-Identifier: GPL-2.0+ BSD-2-Clause > > + * > > + * 64-bit and little-endian target only until we need to support a different > > + * arch that needs this. > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +static const bool debug_en; > > + > > +static void debug(const char *fmt, ...) > > +{ > > + va_list args; > > + > > + va_start(args, fmt); > > + if (debug_en) > > + vprintf(fmt, args); > > +} > > + > > +static bool supported_rela(Elf64_Rela *rela) > > +{ > > + uint64_t mask = 0xffffffffULL; /* would be different on 32-bit */ > > + uint32_t type = rela->r_info & mask; > > + > > + switch (type) { > > +#ifdef R_AARCH64_RELATIVE > > + case R_AARCH64_RELATIVE: > > + return true; > > +#endif > > hi Scott, > the R_AARCH64_RELATIVE is not deinfed in my system. Whether we should define it at somewhere? A newer host elf.h should fix this, but if it's going to be a problem maybe we should just define it ourselves (value is 1027). -Scott