diff options
author | Bernd Schmidt <bernd.schmidt@analog.com> | 2007-10-03 11:41:43 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-10-03 11:41:43 -0400 |
commit | f9720205d1f847cb59e197e851b5276425363f6b (patch) | |
tree | a90405713cd06f8ead8fff25338a2df5427ac95a /fs | |
parent | f778089cb2445dfc6dfd30a7a567925fd8589f1e (diff) |
Binfmt_flat: Add minimum support for the Blackfin relocations
Add minimum support for the Blackfin relocations, since we don't have
enough space in each reloc. The idea is to store a value with one
relocation so that subsequent ones can access it.
Actually, this patch is required for Blackfin. Currently if BINFMT_FLAT is
enabled, git-tree kernel will fail to compile.
Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Cc: David McCullough <davidm@snapgear.com>
Cc: Greg Ungerer <gerg@snapgear.com>
Cc: Miles Bader <miles.bader@necel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/binfmt_flat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index 861141b4f6d6..34e9b06a7444 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c | |||
@@ -742,6 +742,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
742 | * __start to address 4 so that is okay). | 742 | * __start to address 4 so that is okay). |
743 | */ | 743 | */ |
744 | if (rev > OLD_FLAT_VERSION) { | 744 | if (rev > OLD_FLAT_VERSION) { |
745 | unsigned long persistent = 0; | ||
745 | for (i=0; i < relocs; i++) { | 746 | for (i=0; i < relocs; i++) { |
746 | unsigned long addr, relval; | 747 | unsigned long addr, relval; |
747 | 748 | ||
@@ -749,6 +750,8 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
749 | relocated (of course, the address has to be | 750 | relocated (of course, the address has to be |
750 | relocated first). */ | 751 | relocated first). */ |
751 | relval = ntohl(reloc[i]); | 752 | relval = ntohl(reloc[i]); |
753 | if (flat_set_persistent (relval, &persistent)) | ||
754 | continue; | ||
752 | addr = flat_get_relocate_addr(relval); | 755 | addr = flat_get_relocate_addr(relval); |
753 | rp = (unsigned long *) calc_reloc(addr, libinfo, id, 1); | 756 | rp = (unsigned long *) calc_reloc(addr, libinfo, id, 1); |
754 | if (rp == (unsigned long *)RELOC_FAILED) { | 757 | if (rp == (unsigned long *)RELOC_FAILED) { |
@@ -757,7 +760,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
757 | } | 760 | } |
758 | 761 | ||
759 | /* Get the pointer's value. */ | 762 | /* Get the pointer's value. */ |
760 | addr = flat_get_addr_from_rp(rp, relval, flags); | 763 | addr = flat_get_addr_from_rp(rp, relval, flags, &persistent); |
761 | if (addr != 0) { | 764 | if (addr != 0) { |
762 | /* | 765 | /* |
763 | * Do the relocation. PIC relocs in the data section are | 766 | * Do the relocation. PIC relocs in the data section are |