From 53766adfb6c7b93f7e0018489c0474037aca4f6b Mon Sep 17 00:00:00 2001 From: repoman Date: Fri, 4 Mar 2016 14:29:08 -0800 Subject: [PATCH] add a fix folder for expected #include fixes, fix/elf.h doesn't work though --- TODO | 4 ++++ fix/elf.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ out.c | 1 + 3 files changed, 51 insertions(+) create mode 100644 fix/elf.h diff --git a/TODO b/TODO index 2f79c24..a9fc908 100644 --- a/TODO +++ b/TODO @@ -6,3 +6,7 @@ info on the internet about ELF32_ST_INFO: https://developer2developer.wordpress.com/2014/10/01/creating-elf-relocatable-object-files-in-linux/ i think _ST_ might stand for "symbol table" +utility macro ELF32_ST_INFO may be found here: +http://lseos.sourceforge.net/html/elf_8h-source.html +this might have been excluded from Android's header autogen + diff --git a/fix/elf.h b/fix/elf.h new file mode 100644 index 0000000..a233090 --- /dev/null +++ b/fix/elf.h @@ -0,0 +1,46 @@ + + +#ifndef ELF32_ST_INFO + +/* source: http://lseos.sourceforge.net/html/elf_8h-source.html, license below */ + +#define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) + +/*- + * Copyright (c) 1994 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#endif + diff --git a/out.c b/out.c index e4a9ced..a57e89c 100644 --- a/out.c +++ b/out.c @@ -5,6 +5,7 @@ #include "gen.h" #include "ncc.h" #include "out.h" +#include "fix/elf.h" #define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) -- 2.11.4.GIT