Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2008-05-21 18:50:07 +0400
committerNick Clifton <nickc@redhat.com>2008-05-21 18:50:07 +0400
commit804c0cc6d0eae37680bfc2900832958ad4915519 (patch)
treea5f679bf58697cde831f9cf4f7e2328ab169bf9f /include/elf/reloc-macros.h
parent380b8bac123f819fb24eccbea12c23b88a5d12b7 (diff)
* reloc-macros.h: Add a comment about the use of the
END_RELOC_NUMBERS symbol as a sentinel value. * arm.h (END_RELOC_NUMBERS): Provide a maximum value.
Diffstat (limited to 'include/elf/reloc-macros.h')
-rw-r--r--include/elf/reloc-macros.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/elf/reloc-macros.h b/include/elf/reloc-macros.h
index a67419d22..aefb85f2c 100644
--- a/include/elf/reloc-macros.h
+++ b/include/elf/reloc-macros.h
@@ -43,6 +43,34 @@
R_foo_count
};
+ Note: The value of the symbol defined in the END_RELOC_NUMBERS
+ macro (R_foo_count in the case of the example above) will be
+ set to the value of the whichever *_RELOC macro preceeds it plus
+ one. Therefore if you intend to use the symbol as a sentinel for
+ the highest valid macro value you should make sure that the
+ preceeding *_RELOC macro is the highest valid number. ie a
+ declaration like this:
+
+ START_RELOC_NUMBERS (foo)
+ RELOC_NUMBER (R_foo_NONE, 0)
+ RELOC_NUMBER (R_foo_32, 1)
+ FAKE_RELOC (R_foo_illegal, 9)
+ FAKE_RELOC (R_foo_synonym, 0)
+ END_RELOC_NUMBERS (R_foo_count)
+
+ will result in R_foo_count having a value of 1 (R_foo_synonym + 1)
+ rather than 10 or 2 as might be expected.
+
+ Alternatively you can assign a value to END_RELOC_NUMBERS symbol
+ explicitly, like this:
+
+ START_RELOC_NUMBERS (foo)
+ RELOC_NUMBER (R_foo_NONE, 0)
+ RELOC_NUMBER (R_foo_32, 1)
+ FAKE_RELOC (R_foo_illegal, 9)
+ FAKE_RELOC (R_foo_synonym, 0)
+ END_RELOC_NUMBERS (R_foo_count = 2)
+
If RELOC_MACROS_GEN_FUNC *is* defined, then instead the
following function will be generated: