home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / utils / bug / 2452 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  3.4 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!cc.helsinki.FI!kankkune
  2. From: kankkune@cc.helsinki.FI (Risto Kankkunen)
  3. Newsgroups: gnu.utils.bug
  4. Subject: BUG in ld from binutils 2.0
  5. Date: 25 Jan 1993 20:20:05 -0500
  6. Organization: University of Helsinki, Department of Computer Science
  7. Lines: 72
  8. Sender: daemon@cis.ohio-state.edu
  9. Approved: bug-gnu-utils@prep.ai.mit.edu
  10. Distribution: gnu
  11. Message-ID: <1993Jan23.234812.28977@klaava.Helsinki.FI>
  12.  
  13. OK, I'm very pissed off now having twice failed to send a long and
  14. detailed bug report of ld. That damned PNews doesn't like to be
  15. suspended. Here's a terse version of what I intended to say:
  16.  
  17. configure --host=sun4 --target=i386-linux --prefix=$HOME
  18.  
  19. 1. the above configuration sets the default emulation to be the null
  20. string, which ld doesn't like.
  21.  
  22. 2. Isn't there really a command line option to set the output format?
  23. There definitely should be. If I use the vanilla emulation, all I get is
  24. files in the format sunos-big or something like that. Am I really
  25. expected to make a new emulation only to override that to be the linux
  26. format, when the vanilla emulation suits me fine otherwise? Changing the
  27. order of format names in the array doesn't seem to be a good solution,
  28. either.
  29.  
  30. 3. ld doesn't like parentheses in the format name in command line, and
  31. the linux format name happens to have these. The command "ld -b
  32. 'a.out-i386(linux)' foo" produces:
  33.  
  34. ld: Can't open linux
  35. ()
  36.  
  37. without terminating newline.
  38.  
  39. 4. Linux has a page and segment size of 4K while the header size is 1K.
  40. You could achieve this somewhat unusual format with bintutils 1.9 by
  41. lying the segment size to be 1K. The configuration files in 2.0 still
  42. have this trick, although it now produces incorrect code (data segment
  43. gets overwritten by symbols etc.).
  44.  
  45. There isn't a clean fix for this. It appears that ld uses heuristics
  46. that override all the settings in the bfd include files or emulation
  47. definitions concerning the executable header size. The following
  48. stop-gap change helps to find the problem area.
  49.  
  50. What puzzles me is why the generic ld code uses such heuristics.
  51. Shouldn't it leave it to bfd to determine the sizes of the various parts
  52. in the executable? There are already the routines 'set_sizes' and
  53. 'callback' in bfd. Shouldn't these or similar functions be called
  54. instead of any heuristics?
  55.  
  56. PLEASE, mail me a copy of your comments even if you intended only to
  57. post to the group. I'm out of my news connection for a month starting on
  58. Monday, and while I may not be able to read my mail during that period
  59. it at least gets stored for me to read later.
  60.  
  61. *** ./bfd/aoutx.h.orig    Thu Dec 17 19:47:25 1992
  62. --- ./bfd/aoutx.h    Thu Dec 17 19:46:33 1992
  63. ***************
  64. *** 708,714 ****
  65.       ztih = abdp && abdp->text_includes_header;
  66.       obj_textsec(abfd)->filepos = (ztih
  67.                         ? adata(abfd).exec_bytes_size
  68. !                       : adata(abfd).page_size);
  69.       if (! obj_textsec(abfd)->user_set_vma)
  70.         /* ?? Do we really need to check for relocs here?  */
  71.         obj_textsec(abfd)->vma = ((abfd->flags & HAS_RELOC)
  72. --- 708,715 ----
  73.       ztih = abdp && abdp->text_includes_header;
  74.       obj_textsec(abfd)->filepos = (ztih
  75.                         ? adata(abfd).exec_bytes_size
  76. ! /*                      : adata(abfd).page_size);
  77. ! */                      : 1024);
  78.       if (! obj_textsec(abfd)->user_set_vma)
  79.         /* ?? Do we really need to check for relocs here?  */
  80.         obj_textsec(abfd)->vma = ((abfd->flags & HAS_RELOC)
  81.  
  82. -- 
  83.                   dos, windows, nt... are you a victim of the MS disease?
  84.  
  85.