summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Manfredi <Raphael_Manfredi@pobox.com>2020-03-17 10:10:38 +0100
committerRaphael Manfredi <Raphael_Manfredi@pobox.com>2020-03-17 10:35:42 +0100
commit35f0ffa60c3ca18b865718fd83f7b4c5e90f205e (patch)
tree623646a64602e53ba681591292eb17204572d9a2
parent59046dade590cb0cefaaf45896fea7fa5d92e5f1 (diff)
Reworked BFD section tests.
It's not only bfd_get_section_vma() which is impacted! The change in the BFD library, starting with 2.34, is rather that: - bfd_section_xxx() accessors now take only the BFD section as argument. - bfd_get_section_xxx() accessors, which used 2 arguments, are removed. The first argument in bfd_get_section_xxx() calls was the BFD descriptor and it was purely ignored in recent versions of the library.
-rw-r--r--MANIFEST2
-rw-r--r--mcon/U/d_bfd_section.U49
-rw-r--r--mcon/U/d_bfd_section_vma.U80
3 files changed, 50 insertions, 81 deletions
diff --git a/MANIFEST b/MANIFEST
index 35aaa0b..343abc8 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -172,7 +172,7 @@ mcon/U/d_backtrace.U Do we have backtrace()?
mcon/U/d_bcmp.U Do we have bcmp() or memcmp()?
mcon/U/d_bcopy.U Do we have bcopy() or memcpy()?
mcon/U/d_bfd_lib.U Is the BFD library available?
-mcon/U/d_bfd_section_vma.U Does bfd_get_section_vma() take 1 or 2 arguments?
+mcon/U/d_bfd_section.U Do bfd_section_xxx() accessors exist with 1 argument?
mcon/U/d_bindtxtcode.U Do we have bind_textdomain_codeset()?
mcon/U/d_brokstat.U Check whether stat() macros are broken
mcon/U/d_bsdjmp.U Do we have BSD _setjmp() and _longjmp()?
diff --git a/mcon/U/d_bfd_section.U b/mcon/U/d_bfd_section.U
new file mode 100644
index 0000000..d876541
--- /dev/null
+++ b/mcon/U/d_bfd_section.U
@@ -0,0 +1,49 @@
+?RCS: $Id$
+?RCS:
+?RCS: Copyright (c) 2020, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_bfd_section: Trylink cat d_bfd_lib
+?MAKE: -pick add $@ %<
+?S:d_bfd_section:
+?S: This variable conditionally defines the HAS_BFD_SECTION_1ARG symbol,
+?S: which indicates to the C program that the bfd_section_xxx() accessors
+?S: from the BFD library exists and taks only one argument.
+?S:.
+?C:HAS_BFD_SECTION_1ARG:
+?C: This symbol, if defined, indicates that the bfd_section_xxx() accessors
+?C: from the BFD library takes only one argument, which is the new behaviour
+?C: starting from BFD 2.34.
+?C:.
+?H:#$d_bfd_section HAS_BFD_SECTION_1ARG /**/
+?H:.
+: see whether bfd_section_vma exists and takes 1 argument
+case "$d_bfd_lib" in
+$undef)
+ d_bfd_section=$undef
+ ;;
+*)
+ $cat >try.c <<EOC
+?X: See d_bfd_lib.U to understand why we have to define these symbols.
+#define PACKAGE
+#define PACKAGE_VERSION
+#include <bfd.h>
+int main(void)
+{
+ bfd *b = 0;
+ asection *sec = 0;
+
+ return 0 == bfd_section_vma(sec);
+}
+EOC
+ cyn="whether bfd_section_vma() takes 1 argument"
+ set d_bfd_section
+ eval $trylink
+ ;;
+esac
+
diff --git a/mcon/U/d_bfd_section_vma.U b/mcon/U/d_bfd_section_vma.U
deleted file mode 100644
index 0b41f44..0000000
--- a/mcon/U/d_bfd_section_vma.U
+++ /dev/null
@@ -1,80 +0,0 @@
-?RCS: $Id$
-?RCS:
-?RCS: Copyright (c) 2020, Raphael Manfredi
-?RCS:
-?RCS: You may redistribute only under the terms of the Artistic License,
-?RCS: as specified in the README file that comes with the distribution.
-?RCS: You may reuse parts of this distribution only within the terms of
-?RCS: that same Artistic License; a copy of which may be found at the root
-?RCS: of the source tree for dist 4.0.
-?RCS:
-?MAKE:d_bfd_section_vma d_bfd_section_vma2: Trylink cat cp rm d_bfd_lib
-?MAKE: -pick add $@ %<
-?S:d_bfd_section_vma:
-?S: This variable conditionally defines the HAS_BFD_SECTION_VMA_1ARG symbol,
-?S: which indicates to the C program that the bfd_get_section_vma() routine from
-?S: the BFD library takes only one argument.
-?S:.
-?S:d_bfd_section_vma2:
-?S: This variable conditionally defines the HAS_BFD_SECTION_VMA_2ARGS symbol,
-?S: which indicates to the C program that the bfd_get_section_vma() routine from
-?S: the BFD library takes two arguments, the first being probably ignored.
-?S: This was the old behaviour (before 2020-03 at least), the new behaviour
-?S: being to use a new 1-argument signature.
-?S:.
-?C:HAS_BFD_SECTION_VMA_1ARG:
-?C: This symbol, if defined, indicates that the bfd_get_section_vma() routine
-?C: from the BFD library takes only one argument, which is the new behaviour
-?C: starting from 2020-03 at least.
-?C:.
-?C:HAS_BFD_SECTION_VMA_2ARGS:
-?C: This symbol, if defined, indicates that the bfd_get_section_vma() routine
-?C: from the BFD library takes two arguments, which is the old behaviour,
-?C: with the first argument probably ignored underneath.
-?C:.
-?H:#$d_bfd_section_vma HAS_BFD_SECTION_VMA_1ARG /**/
-?H:#$d_bfd_section_vma2 HAS_BFD_SECTION_VMA_2ARGS /**/
-?H:.
-?F:!head.c
-: see whether d_bfd_get_section_vma exists and takes 1 or 2 arguments
-$cat >head.c <<EOC
-?X: See d_bfd_lib.U to understand why we have to define these symbols.
-#define PACKAGE
-#define PACKAGE_VERSION
-#include <bfd.h>
-int main(void)
-{
- bfd *b = 0;
- asection *sec = 0;
-EOC
-case "$d_bfd_lib" in
-$undef)
- d_bfd_section_vma=$undef
- d_bfd_section_vma2=$undef
- ;;
-*)
- $cp head.c try.c
- $cat >>try.c <<EOC
- return 0 == bfd_get_section_vma(b, sec);
-}
-EOC
- cyn="whether bfd_get_section_vma() takes 2 arguments"
- set d_bfd_section_vma2
- eval $trylink
- ;;
-esac
-case "$d_bfd_lib$d_bfd_section_vma2" in
-$define$undef)
- $cp head.c try.c
- $cat >>try.c <<EOC
- return 0 == bfd_get_section_vma(sec);
-}
-EOC
- cyn="that a 1-argument bfd_get_section_vma() indeed exists"
- set d_bfd_section_vma
- eval $trylink
- ;;
-*) d_bfd_section_vma=$undef;;
-esac
-$rm -f head.c
-