1 /* =================================================================
5 * Relocation types for the i386 processor.
7 * =================================================================
8 * ####ECOSGPLCOPYRIGHTBEGIN####
9 * -------------------------------------------
10 * This file is part of eCos, the Embedded Configurable Operating
12 * Copyright (C) 2005 eCosCentric LTD.
13 * Copyright (C) 2005 Andrew Lunn <andrew.lunn@ascom.ch>.
15 * eCos is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 or (at your option)
20 * eCos is distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with eCos; if not, write to the Free Software Foundation,
27 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
29 * As a special exception, if other files instantiate templates or
30 * use macros or inline functions from this file, or you compile this
31 * file and link it with other works to produce a work based on this
32 * file, this file does not by itself cause the resulting work to be
33 * covered by the GNU General Public License. However the source code
34 * for this file must still be made available in accordance with
35 * section (3) of the GNU General Public License.
37 * This exception does not invalidate any other reasons why a work
38 * based on this file might be covered by the GNU General Public
41 * -------------------------------------------
42 * ####ECOSGPLCOPYRIGHTEND####
43 * =================================================================
44 * #####DESCRIPTIONBEGIN####
46 * Author(s): Anthony Tonizzo (atonizzo@gmail.com), andrew.lunn@ascom.ch
51 * ####DESCRIPTIONEND####
53 * =================================================================
56 #include <cyg/infra/diag.h> // For diagnostic printing.
57 #include <cyg/hal/hal_cache.h>
58 #include <cyg/hal/hal_io.h>
60 #include <pkgconf/objloader.h>
61 #include <cyg/objloader/elf.h>
62 #include <cyg/objloader/objelf.h>
64 #if defined(CYGPKG_HAL_I386) || defined(CYGPKG_HAL_SYNTH_I386)
66 cyg_ldr_flush_cache(void)
74 // sym_type Type of relocation to apply,
75 // mem Address in memory to modify (relocate).
78 cyg_ldr_relocate(cyg_int32 sym_type, cyg_uint32 mem, cyg_int32 sym_value)
82 // PPC uses rela, so we have to add the addend.
86 HAL_READ_UINT32(mem , i);
87 HAL_WRITE_UINT32(mem, i + sym_value );
90 HAL_READ_UINT32(mem , i);
91 HAL_WRITE_UINT32(mem, i + sym_value - mem);
94 ELFDEBUG("FIXME: Unknown relocation value!!!\n");
98 #endif // CYGPKG_HAL_I386 || CYGPKG_HAL_SYNTH_I386